This is the mail archive of the libstdc++@gcc.gnu.org mailing list for the libstdc++ 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: bad bug in map<>::insert


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.




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