Possible Duplicate:
(How) can I count the items in an enum?
Is there a way to get the number of constants in enum?
For example:
enum C{id,value};
And later this would return 2:
//pseudo code
get<C>::value
And also, is it possible to access those constants via [] optor? Like i.e.:
C[0] would return id