Is there a simple way in C++ to convert a string to an enum (similar to Enum.Parse in C#)? A switch statement would be very long, so I was wondering i
Enum.Parse
Use std::map and use boost::map_list_of to easily initialize it.
std::map
Example,
enum X { A, B, C }; std::map xmap = boost::map_list_of("A", A)("B", B)("C",C);