#include <map>
#include <sstream>
#include <string>
using std::string;
struct VarValue
{
std::string str;
VarValue() {}
template <class T> operator T()
{
T x;
std::istringstream stream(str);
stream >> x;
return x;
}
template <class T> void Assign(T x)
{
std::ostringstream stream;
stream << x;
str = stream.str();
}
template <class T> VarValue(T x)
{
Assign(x);
}
template <class T> VarValue &operator=(T x)
{
Assign(x);
return *this;
}
//для большей путаницы можно другие операторы определить.
};
std::map<std::string, VarValue> variables_;
#define $(var) (variables_[#var])
#include <iostream>
//использование
int main()
{
$(hello) = "test";
$(world) = 1;
$(other_var) = int($(world)) + 10;
std::cout << (string)$(hello) + (string)$(other_var);
}