This is the mail archive of the gcc-bugs@gcc.gnu.org mailing list for the GCC project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: libstdc++/10794: std::map's erase method invalidates reverse_iterators


Synopsis: std::map's erase method invalidates reverse_iterators

State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Thu May 15 16:01:23 2003
State-Changed-Why:
    Not a bug: see 24.4.1.1 (or Stroustrup, p. 557). In a
    nutshell, reverse_iterator is implemented in terms of a
    plain iterator (called 'current' in the standard) which
    points one position forward. Therefore, in your testcase, upon erase(90), jt 'current' iterator (which points to 90)
    is invalidated.

http://gcc.gnu.org/cgi-bin/gnatsweb.pl?cmd=view%20audit-trail&database=gcc&pr=10794


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]