Let's say I have some kind of collection and I obtained an iterator for the beginning of it. Now let's 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 itself).
- Use the iterator obtained at step 1. Is it stil valid according to STL standard?!