G
Gernot Frisch
restart:
for (std::map<x,y>::iterator it = m.begin(); it!=m.end(); ++it)
{
if( it->second.isbad() )
{
std::map<x,y>::iterator next = it;
++next;
m.erase(it);
it=next;
// goto restart;
}
}
this does not remove all bad ones... If I insert a "goto restart" it
works...
What am I doing wrong?
for (std::map<x,y>::iterator it = m.begin(); it!=m.end(); ++it)
{
if( it->second.isbad() )
{
std::map<x,y>::iterator next = it;
++next;
m.erase(it);
it=next;
// goto restart;
}
}
this does not remove all bad ones... If I insert a "goto restart" it
works...
What am I doing wrong?