This is the mail archive of the
libstdc++@gcc.gnu.org
mailing list for the libstdc++ project.
Re: bad bug in map<>::insert
- From: Paolo Carlini <pcarlini at unitus dot it>
- To: Nathan Myers <ncm-nospam at cantrip dot org>
- Cc: libstdc++ at gcc dot gnu dot org
- Date: Wed, 21 Nov 2001 02:41:06 +0100
- Subject: Re: bad bug in map<>::insert
- References: <20011121013121.A59594@cantrip.org>
Nathan Myers wrote:
> I have found what seems like a serious bug in the member
> std::map<>::insert(iterator, const value_type&). Passing a
> hint can cause the map to insert the value in the wrong place,
> silently violating the map's ordering invariant.
>
> Do you agree this is a bug?
I agree with you. But the fact is, I'm *not* able to reproduce it with either 3.0.2 or 3.1 current...
A quick look at the ChangeLog reveal that the following patch was committed between 3.0.1 and 3.0.2:
2001-08-24 Sylvain Pion <Sylvain.Pion@sophia.inria.fr>
Phil Edwards <pme@sources.redhat.com>
PR libstdc++/3349
* include/bits/stl_tree.h (insert_unique): Revert last change.
Values inserted at begin() must be less, not greater, than *begin()'s.
* testsuite/23_containers/map_insert.cc: New file.
Cheers,
Paolo.