invalidation of iterators on deque

Discussion in 'C++' started by subramanian100in@yahoo.com, India, May 20, 2008.

  1. , India

    , India Guest

    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.

    Thanks
    V.Subramanian
     
    , India, May 20, 2008
    #1
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Russell Warren
    Replies:
    5
    Views:
    421
    Tim Peters
    May 2, 2006
  2. Ben Pfaff
    Replies:
    2
    Views:
    349
    Ben Pfaff
    Feb 1, 2008
  3. , India
    Replies:
    1
    Views:
    305
    joseph cook
    Aug 19, 2008
  4. , India
    Replies:
    2
    Views:
    557
    Barry
    Sep 30, 2008
  5. , India
    Replies:
    8
    Views:
    297
    Bo Persson
    Jul 27, 2010
Loading...

Share This Page