stdcxx-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Liviu Nicoara <>
Subject Re: Does a list iterator remain valid after removing an element in the list?
Date Wed, 06 Sep 2006 15:31:27 GMT
Iterators and references to the erased elements are invalidated, as per

- L

Geoffrey Winn wrote:
> I'm investigating an abort that I get from a Tuscant SDO test prgram when
> built using stdcxx. I still have some investigation to do however based on
> the code I've read I'd like to clarify the following.
> If I have a std::<list> and I've created an iterator to examine each 
> item in
> the list in turn, if I then use erase to delete one of those items eg
> iter = the_list.erase(iter);
> does the iterator remain valid?
> I'm asking this because the abort occurs in an assert statement within the
> implementation of the ++ operator for the iterator.
> Thanks in advance.
> Geoff.

View raw message