std::vector ints; // ... fill ints with random values for(std::vector::iterator it = ints.begin(); it != ints.end(); ) { if(*it < 10)
Check out the information here (cplusplus.com):
Delete last element Removes the last element in the vector, effectively reducing the vector size by one and invalidating all iterators and references to it.
Delete last element
Removes the last element in the vector, effectively reducing the vector size by one and invalidating all iterators and references to it.