This is the mail archive of the 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++/6791: hash_map: bad end() iterator

Sorry for the false report. Thank you for the explanations, Vadim

-----Original Message-----
From: []
Sent: Friday, May 24, 2002 10:37 AM
Subject: Re: libstdc++/6791: hash_map: bad end() iterator

Synopsis: hash_map: bad end() iterator

Responsible-Changed-From-To: unassigned->paolo
Responsible-Changed-By: paolo
Responsible-Changed-When: Fri May 24 10:36:38 2002
State-Changed-From-To: open->closed
State-Changed-By: paolo
State-Changed-When: Fri May 24 10:36:38 2002
    User error. See Josuttis pp. 204-205 for a clear
    explanation of why this is, in general, an incorrect use
    of erase() (it works for map only "by chance"). In a
    nutshell, fooH.erase(iter) invalidates iter as an iterator
    of HT and the following ++iter results in undefined
    behavior. The correct way is the following:
      for (HT::iterator iter=fooH.begin(); iter!=fooH.end();) {
        cerr << "erasing\n";
    Thanks for your report, Paolo.

This e-mail, and any attachments thereto, is intended only for use by the
addressee(s) named herein and may contain legally privileged and/or
confidential information.  If you are not the intended recipient of this
e-mail, you are hereby notified that any dissemination, distribution or
copying of this e-mail, and any attachments thereto, is strictly prohibited.
If you have received this e-mail in error, please immediately notify me and
permanently delete the original and any copy of any e-mail and any printout

E-mail transmission cannot be guaranteed to be secure or error-free.  The
sender therefore does not accept liability for any errors or omissions in
the contents of this message which arise as a result of e-mail transmission.


Knight Trading Group may, at its discretion, monitor and review the content
of all e-mail communications. 

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