Is it possible to iterate over all of the values in a std::map
using just a "foreach"?
This is my current code:
std::map<float, MyClass*> foo ;
for (map<float, MyClass*>::iterator i = foo.begin() ; i != foo.end() ; i ++ ) {
MyClass *j = i->second ;
j->bar() ;
}
Is there a way I can do the following?
for (MyClass* i : /*magic here?*/) {
i->bar() ;
}