I would like to loop through an std::map and delete items based on their contents. How best would this be done?
std::map
for(MyMap::iterator it = mymap.begin(); it!=mymap.end(); ) { if(mycondition(it)) it = mymap.erase(it); else it++; }
edit: seems that this works in MSVC only
edit2: in c++0x this works for associative containers too