Assuming I'm in control of how many elements my vector has allocated through reserve(), is it safe to keep my current iterators to existing elements in between calls to insert() and erase() as long as the vector doesn't need to reallocate?
Printable View
Assuming I'm in control of how many elements my vector has allocated through reserve(), is it safe to keep my current iterators to existing elements in between calls to insert() and erase() as long as the vector doesn't need to reallocate?
http://www.sgi.com/tech/stl/Sequence.html
Note 3:
[3] Warning: there is no guarantee that a valid iterator on a is still valid after an insertion or an erasure