Boost logo

Boost :

Subject: Re: [boost] [containers] Are there flat_map/set and stable_vector proposals at work?
From: Jonathan Wakely (jwakely.boost_at_[hidden])
Date: 2013-10-28 06:23:11


On 28 October 2013 09:04, Rob Stewart wrote:
> On Oct 27, 2013, at 8:32 AM, Jonathan Wakely <jwakely.boost_at_[hidden]> wrote:
>
>> On 25 October 2013 20:44, Rob Stewart wrote:
>>>
>>> A flat_map, backed by std::array, is quite possibly no faster than a normal C++11 map, with a suitable allocator. A C++03 map won't use its allocator for nodes, but IIRC, a C++11 map will.
>>
>> What do you mean by "use"?
>>
>> std::map has always allocated the memory for its nodes using its allocator.
>
> 03's allocator interface means that the element and node allocations were done via different allocator types, which leads to distinct allocations. I don't recall the details, but that prevents using the same memory for both, as I recall.

You're mistaken. The element has always been embedded in the node, so
only the node is allocated.


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