
Deleting From A Collection in STL is hard - fogus
http://www.sambal.org/2010/07/deleting-from-a-collection-in-stl/
======
echaozh
If I have to iterate over all the objects in a container and erase some of
them, I always push the keys/indices into another deque first. And then the
deque is iterated through to remove those items from the original set (in the
reverse order in the case of a vector).

I'm not very confident in the validity of iterators.

