... with a specific set of mutating operations that (may) alter the container's structure (eg, element insertions and removals).
Altering the value of one element of the container doesn't invalidate iterators or references to any element. You can make as many mutating passes over a std::vector as you like without invalidating anything.
Things only start to get dicey when you push_back(), insert(), erase(), etc.
... with a specific set of mutating operations that (may) alter the container's structure (eg, element insertions and removals).
Altering the value of one element of the container doesn't invalidate iterators or references to any element. You can make as many mutating passes over a std::vector as you like without invalidating anything.
Things only start to get dicey when you push_back(), insert(), erase(), etc.