[Bug c++/41480] std::map.erase on cygwin
lifelong830114 at gmail dot com
gcc-bugzilla@gcc.gnu.org
Mon Sep 28 09:31:00 GMT 2009
------- Comment #4 from lifelong830114 at gmail dot com 2009-09-28 09:31 -------
(In reply to comment #3)
> In any case, the code is invalid, try building (and then running) with
> -D_GLIBCXX_DEBUG to see the problem. This way, for example, is fine:
> for (; it != mymap.end() ; /* it++ */) {
> mymap.erase((*it++).first);
> }
I think the origin code is wrong, after "erase(...)" the space pointed by "it"
has been free, so the operater "it++" is wrong, is it?
But this origin code is fine on linux, could you tell me why?
--
lifelong830114 at gmail dot com changed:
What |Removed |Added
----------------------------------------------------------------------------
Status|RESOLVED |UNCONFIRMED
Resolution|INVALID |
http://gcc.gnu.org/bugzilla/show_bug.cgi?id=41480
More information about the Gcc-bugs
mailing list