I am wondering if I can somehow return enum values from a method, using templates or otherwise. Here is an outline of what I want to do. The specific enums are declared outside the scope of the State class.
class State {
map<string, int> values;
//...
template <enum E>
E getEnumValue(const string& key) const;
}
I have never written any code using either templates or C++ enums before, so I don't really know where to start.
Thanks.



LinkBack URL
About LinkBacks



CornedBee