Saturday, March 7, 2009

i use this code to prune a set in c++. used to get invalid iterators before

while (it != m.end())
if (mustBeDeleted(it))
m.erase(it++);
else ++it;

No comments: