Topic: Invalidation of stored iterator representing end of a std::set.


Author: Richard See <Richard.See@vega.co.uk>
Date: 1997/08/19
Raw View
I've been using the Rogue Wave implementation of the STL that comes with
Borland C++ 5.01.  According to the Rogue Wave Standard C++ Library
User's Guide and Tutorial the insertion or removal of values from a set
does not invalidate iterators or references to other elements in the
collection.
I can't spot this in the (2nd December 1996) draft standard anywhere, is
this behaviour defined in the draft?
Same question again for the iterator representing the end of a set, only
stronger: are there any operations that can be performed on the set that
will invalidate a stored iterator represent the end of the set?  (FWIW,
RW's std::set<T>::swap function swaps the iterators that end returns,
but I couldn't spot anything else which looked like it would change it.)

Thanks,

Richard.
---
[ comp.std.c++ is moderated.  To submit articles: Try just posting with your
                newsreader.  If that fails, use mailto:std-c++@ncar.ucar.edu
  comp.std.c++ FAQ: http://reality.sgi.com/austern/std-c++/faq.html
  Moderation policy: http://reality.sgi.com/austern/std-c++/policy.html
  Comments? mailto:std-c++-request@ncar.ucar.edu
]