title: generic way to print out variable name in c++
body: <p>given a class </p>
  
  <pre><code>struct {
    int a1;
    bool a2;
    ...
    char* a500;
    ...
    char a10000;      
  }
  </code></pre>
  
  <p>I want to print or stream out </p>
  
  <pre><code>"a1 value is SOME_VALUE"  
  "a2 value is SOME_VALUE"
  "a500 value is SOME_VALUE"
  ...
  "a10000 value is SOME_VALUE"
  </code></pre>
  
  <p>the type of the member variables are not the same (mainly, int, bool, char*, etc, i.e., no need to overload &lt;&lt; operator), and the member variable name could be named with anything, i.e., no rule to follow. Instead of typing explicitely one by one (very big tedious, and error-prone work), is there any generic way?</p>
  
  <p>Thanks for any comments!</p>