Possible Duplicate:
C++: Iterate through an enum
Enumerate over an enum in C++
I have:
enum topics {gui, combat}
std::map <topics, std::vector<cSubscriber *>> subscribers;
And I want something like (pseudocode):
FOR EACH (value in topics enum)
{
std::vector<cSubscriber *> & temp = subscribers[value];
}
How can I do that in C++11? I know that there is new foreach for containers but I don't think it works with enums.