Suppose I have a class AS, and I make a map that contains pointers of that type, and uses as keys, the addresses of AS objects, so:
std::map
Suppose I add 2 items. And execute the following loop.
typedef std::map
for(it_type iterator = mymap.begin(); iterator != mymap.end(); iterator++) {
iterator->first->update().
}
I all works fine. Then,suppose I delete one item.
And execute the loop again.
That loop raises an error saying that it cannot increment the iterator.
What could be the problem?