std::multimap preserving order in erase() and insert()?

Jonathan Wakely jwakely.gcc@gmail.com
Wed Nov 28 09:41:00 GMT 2012


On 28 November 2012 07:24, Hei Chan wrote:
> Hi,
>
> I have a similar question to this: http://stackoverflow.com/questions/2643473/does-stdmultiset-guarantee-insertion-order
>
>
> I wonder whether GCC 4.6.2 has already implemented the part of c11 standard that guarantees to preserve the order of insertion as well as the order of insertion of erasure in std::multimap.

GCC has always provided that guarantee.

If you read the linked papers and DRs you'll see that they say all
current [as of 2002] implementations provide stable ordering, even
though it wasn't stated as a requirement by the previous standard.

http://www.open-std.org/jtc1/sc22/wg21/docs/lwg-defects.html#371
http://www.open-std.org/jtc1/sc22/wg21/docs/papers/2005/n1780.html#Equal
range stability



More information about the Gcc-help mailing list