std::vector ints; // ... fill ints with random values for(std::vector::iterator it = ints.begin(); it != ints.end(); ) { if(*it < 10)
Iterators are only invalidated on reallocation of storage. Google is your friend: see footnote 5.
Your code is not working for other reasons.