This is the mail archive of the
mailing list for the libstdc++ project.
Re: bad bug in map<>::insert
- From: Phil Edwards <pedwards at disaster dot jaj dot com>
- To: libstdc++ at gcc dot gnu dot org
- Date: Tue, 20 Nov 2001 20:53:28 -0500
- Subject: Re: bad bug in map<>::insert
- References: <20011121013121.A59594@cantrip.org>
On Wed, Nov 21, 2001 at 01:31:21AM +0000, 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.
> gcc version 3.0.1
Testcase 23_containers/map_insert.cc checks this, and
Note that GCC releases prior to 3.0.2 had a bug in the case with
hint == begin() for the map and set classes. You should not use a hint
argument in those releases.
This was fixed three months ago.
If ye love wealth greater than liberty, the tranquility of servitude greater
than the animating contest for freedom, go home and leave us in peace. We seek
not your counsel, nor your arms. Crouch down and lick the hand that feeds you;
and may posterity forget that ye were our countrymen. - Samuel Adams