Boost logo

Boost :

Subject: [boost] [Container] Provide more guarantees for flat_multimap
From: Vinícius dos Santos Oliveira (vini.ipsmaker_at_[hidden])
Date: 2014-08-14 23:28:45


Currently, flat_multimap mirrors C++98's multimap concept.

I'd like to propose an update to flat_multimap fulfil the C++11's multimap
concept.

The part I'm particularly interested are guarantees about preserving the
insertion ordering for elements with equivalent keys.

On ISO/IEC 14882-2011, 23.2.4 - associative container requirements, pages
741 and 742, you can see the effects for a_eq.emplace and a_eq.insert ends
with "If a range containing elements equivalent to t exists in a_eq, t is
inserted at the end of that range". I see no similar guarantees on the
Boost's flat_multimap documentation[1].

This feature is useful, for instance, in HTTP messages, where field
reordering is illegal[2] if the keys are equivalent.

I did a few tests and it looks to me that flat_multimap already provides
these guarantees, but before I go check the source and possibly provide
patches, I need to know if there is interest in turning this accidental
behaviour into intentional behaviour through documented guarantees.

[1]
http://www.boost.org/doc/libs/1_56_0/doc/html/boost/container/flat_multimap.html
[2] http://tools.ietf.org/html/rfc7230#section-3.2.2

-- 
Vinícius dos Santos Oliveira
https://about.me/vinipsmaker

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk