W
wenmang
Hi,
I am wondering what the safe way to delete a map entry through its
iterator. There is a example from the book of Nicolai Josuttis:
for(map::iterator itr=myMap.begin();itr !=myMap.end())
{
if(itr->value == something)
myMap.erase(itr++);
else
itr++;
}
is there other way to do so or this is the only way?
thx.
I am wondering what the safe way to delete a map entry through its
iterator. There is a example from the book of Nicolai Josuttis:
for(map::iterator itr=myMap.begin();itr !=myMap.end())
{
if(itr->value == something)
myMap.erase(itr++);
else
itr++;
}
is there other way to do so or this is the only way?
thx.