Re: Erase-remove idiom on std:vector - will it invalidate iterators ?

Discussion in 'C++' started by Öö Tiib, Jun 16, 2010.

  1. Öö Tiib

    Öö Tiib Guest

    On Jun 16, 11:52 pm, Stephen Howe <sjhoweATdialDOTpipexDOTcom> wrote:
    >
    > I know that push_back() and insert() will invalidate iterators if the current capacity is exceeded, but I have not seen any
    > guarantees on erase() or clear() (there should be if there are not).


    Maybe read some manual then to see what they say about iterators? For
    example:

    http://www.cplusplus.com/reference/stl/vector/erase/

    It clearly tells what iterators will be invalidated after erase.
    Öö Tiib, Jun 16, 2010
    #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. bartek
    Replies:
    3
    Views:
    646
    Victor Bazarov
    Mar 7, 2004
  2. Jim Langston
    Replies:
    10
    Views:
    735
    bjeremy
    Jan 8, 2007
  3. Replies:
    3
    Views:
    322
    terminator
    Mar 25, 2007
  4. Alan Woodland
    Replies:
    2
    Views:
    784
    James Kanze
    Mar 24, 2009
  5. K. Frank
    Replies:
    3
    Views:
    442
    K. Frank
    May 31, 2013
Loading...

Share This Page