title: C++ template meta-programming, number of member variables?
body: <p>Is it possible in C++ to determine number of variables/fields in the generic class?
  for example</p>
  
  <pre><code>// suppose I need metaclass number_members determines number of members
  
  struct example { int i, j; };
  assert(number_members&lt;example&gt;::value==2);
  </code></pre>
  
  <p>I looked through mpl but could not find implementation.</p>
  
  <p>thanks.</p>