sequential container insert() function



 DEVELOP > c-Plus-Plus > sequential container insert() function

LINK TO THIS PAGE  


rating :  0   |  0


  Page 1 of 1
Topic: DEVELOP > c-Plus-Plus
User: "India"
Date: 06 Feb 2008 02:42:43 AM
Object: sequential container insert() function
Suppose I have a vector<T> or deque<T> for some type T.
Suppose vector<T>::iterator iter is an iterator.
Then consider the operation
vector<T>::iterator nit = container.insert(iter, T());
After the insertion, iter will be invalidated for both vector<T>,
deque<T>.
However for list<T>, the same operation under g++ 3.4.3, does not seem
to invalidate iter. From this, can it be concluded that list<T> does
not invalidate iterators after insert operation ? What does the
standard say regarding this ?
Kindly clarify.
Thanks
V.Subramanian
.

 

NEWER

pg.1232     pg.940     pg.716     pg.544     pg.412     pg.311     pg.234     pg.175     pg.130     pg.96     pg.70     pg.50     pg.35     pg.24     pg.16     pg.10     pg.6     pg.3     pg.1

OLDER