C++ Simple Reflection without Macros: Print Variable Name and Its Value

Viewed 3195

Is there a non-macro way in C++ of printing a variable name with its value. Here is the macro way:

#define SHOW(a) std::cout << #a << ": " << (a) << std::endl

PS: I'm using Linux and do not need a cross-platform solution

5 Answers
Related