Number of permissible active iterators into a vector?

Yes, it's valid You can have as many iterators into a vector as your system has memory to hold iterators The special name for this type of container is "any STL container". All containers allow this Maybe explain why you think this shouldn't be allowed?

Yes, it's valid. You can have as many iterators into a vector as your system has memory to hold iterators. The special name for this type of container is "any STL container".

All containers allow this. Maybe explain why you think this shouldn't be allowed?

As long as you don't do operations that render the other iterators invalid, there isn't any limit on the # of iterators. Some operations (like insert or remove) may render all of the other iterators invalid. The way STL container iterators work, there's no way for them to (generally) deal with insert and remove done through other iterators.

Note that using container functions to insert/remove elements will ALSO render the iterators invalid. The underlying issue is that STL containers don't know anything about the active iterators, so they can't tell the iterators that something has changed.

That's definitely permissible. The thing you have to worry about is if you start erasing or inserting elements. Different containers have different behavior for invalidation of iterators by modifying functions, you'll have to look at the documentation.

Erase on a vector, for example, invalidates all iterators and element references after the element that was erased.

I cant really gove you an answer,but what I can give you is a way to a solution, that is you have to find the anglde that you relate to or peaks your interest. A good paper is one that people get drawn into because it reaches them ln some way.As for me WW11 to me, I think of the holocaust and the effect it had on the survivors, their families and those who stood by and did nothing until it was too late.

Related Questions