470,833 Members | 1,858 Online
Bytes | Developer Community
New Post

Home Posts Topics Members FAQ

Post your question to a community of 470,833 developers. It's quick & easy.

invalidation of iterators on deque

I am copying the following paragraph, as it is, from Stanley Lippman's
C++ Primer 4th edition, page 334.

It says:

"Inserting elements at the front or back of a deque does not
invalidate any iterators. Erasing the front or back element
invalidates only iterators referring to the elements(s) erased.
Inserting or erasing anywhere else in the deque invalidates all
iterators referring to elements of the deque".

I thought insertion or erasure of elements in a deque can potentially
invalidate all iterators into the deque irrespective of position(this
is what happens to vector I think). But the above paragraph says
something different.

Kindly clarify which is correct.

Jun 27 '08 #1
0 768

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

9 posts views Thread by Alexander Stippler | last post: by
18 posts views Thread by desktop | last post: by
2 posts views Thread by subramanian100in | last post: by
reply views Thread by mihailmihai484 | last post: by
By using this site, you agree to our Privacy Policy and Terms of Use.