Possible Duplicate:
Is it possible to define enumalpha?
Is there any equivalent of Java Enum.valueOf(string) on C++?
Possible Duplicate:
Is it possible to define enumalpha?
Is there any equivalent of Java Enum.valueOf(string) on C++?
No, there isn't even the much simpler task of going the other way (enum to string), you'd need to write it yourself
There's no table of names generated by the compiler (unless you count debug information), but if you create one (or use e.g. doxygen which parses the source code and can output such lists in XML format) then you can use a dictionary of some type, such as std::map<string, int>
to turn an identifier into its numeric value.