I\'ve got code that looks like this:
for (std::list::iterator i=items.begin();i!=items.end();i++) { bool isActive = (*i)->update(); /
Use std::remove_if algorithm.
Edit: Work with collections should be like: 1. prepare collection. 2. process collection.
Life will be easier if you won't mix this steps.