I have a vector that holds items that are either active or inactive. I want the size of this vector to stay small for performance issues, so I want items that have been mark
I agree with wilx's answer. Here is an implementation:
// curFiles is: vector < string > curFiles; vector< string >::iterator it = curFiles.begin(); while(it != curFiles.end()) { if(aConditionIsMet) { it = curFiles.erase(it); } else ++it; }