Talk About Network

Google


Register and Login
Nick
Password
Register create new account Sign up is FREE and you can post replies, new topics, bookmark posts and more!
Recover lost password


Programming > C++ > sequential cont...
Latest [ Topics | Posts ] Archive Post A New Topic Post a Reply
<< Topic < Post Post 1 of 2 Topic 43119 of 48044
Post > Topic >>

sequential container insert() function

by "subramanian100in@[EMAIL PROTECTED] India" <subramanian100in@[EMAIL PROTECTED] > Feb 6, 2008 at 12:42 AM

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
 




 2 Posts in Topic:
sequential container insert() function
"subramanian100in@[E  2008-02-06 00:42:43 
Re: sequential container insert() function
James Kanze <james.kan  2008-02-06 03:06:07 

Post A Reply:
  Go here to Signup

AddThis Feed Button


About - Advertising - Contact - Frequently Asked Questions - Privacy Policy - Terms of Use - Signup

Contact
tan12V112 Wed Oct 15 22:46:11 CDT 2008.