I\'m writing a nodal path finding algorithm. I need to run through a multimap and delete elements out of it under certain conditions, but keep iterating through the multimap
std::multimap m;
typedef std::multimap::iterator Iter;¸
for (Iter it = m.begin(); it != m.end(); ) {
if ( /* some condition */ ) {
Iter save = it;
++it;
m.erase(save);
} else
++it;
}