Lets say I have some kind of collection an I obtained an iterator for the beginning of it. Now lets say I modified the collection. Can I still use the iterator safely? (regardless of the type of the collection or the iterator)
To avoid confusion , Here is the order of operations I talk about:
- Get an iterator of the collection.
- Modify the collection (obviously , not an element in it , but the collection it self)
- Use the iterator obtained at step '1' (Is it stil valid according to STL standard ???!?!!!!!?!)