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
Removing items from the middle of a vector will invalidate all iterators to that vector, so you cannot do this (update: without resorting to Wilx's suggestion).
Also, if you're worried about performance, erasing items from the middle of a vector is a bad idea anyway. Perhaps you want to use an std::list?