Number of "constants" in enum
<blockquote>
  <p><strong>Possible Duplicate:</strong><br>
  <a href="http://stackoverflow.com/questions/2102582/how-can-i-count-the-items-in-an-enum">(How) can I count the items in an enum?</a>  </p>
</blockquote>



<p>Is there a way to get the number of constants in enum?<br>
For example:  </p>

<pre><code>enum C{id,value};
</code></pre>

<p>And later this would return 2:  </p>

<pre><code>//pseudo code
get&lt;C&gt;::value 
</code></pre>

<p>And also, is it possible to access those constants via [] optor? Like i.e.:<br>
C[0] would return id</p>
