Velocity Reviews - Computer Hardware Reviews

Velocity Reviews > Newsgroups > Programming > C++ > invalidate the iterators

Reply
Thread Tools

invalidate the iterators

 
 
heng
Guest
Posts: n/a
 
      01-28-2007
A lot of operations such as erase and popfront will invalidate
iterators of vector, however, what will happen to list? Is there any
influence to list?
Thanks a lot.

 
Reply With Quote
 
 
 
 
Kai-Uwe Bux
Guest
Posts: n/a
 
      01-28-2007
heng wrote:

> A lot of operations such as erase and popfront will invalidate
> iterators of vector, however, what will happen to list? Is there any
> influence to list?


Insertions into a list do not invalidate any iterators. Erasing elements
from a list invalidates those and only those iterators pointing to that
element. [See 23.2.2.3]


Best

Kai-Uwe Bux

 
Reply With Quote
 
 
 
Reply

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
Re: Erase-remove idiom on std:vector - will it invalidate iterators ? Öö Tiib C++ 0 06-16-2010 09:11 PM
Does std::unique invalidate iterators ever? Alan Woodland C++ 2 03-24-2009 09:01 PM
Does .push_back invalidate existing vector iterators? Jim Langston C++ 10 01-08-2007 08:12 PM
Iterators and reverse iterators Marcin Kaliciñski C++ 1 05-08-2005 09:58 AM
Quickie: Can std::deque::push_back() invalidate its iterators? bartek C++ 3 03-07-2004 10:17 PM



Advertisments
 



1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57