Alternatively #define VariableName name and then int VariableName = 5;, which relies on the preprocessor. But, since I abhor the preprocessor, please don't do that.
Solutions to what? What are you actually trying to accomplish with this approach? Why do you need a variable whose name is defined in another variable?
std::unordered_map<string, int>and then domymap[VariableName] = 5;#define VariableName nameand thenint VariableName = 5;, which relies on the preprocessor. But, since I abhor the preprocessor, please don't do that.