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

paolo@gcc.gnu.org paolo@gcc.gnu.org
Thu May 15 16:24:00 GMT 2003


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



More information about the Gcc-bugs mailing list