Boost logo

Boost :

Subject: Re: [boost] [containers] Are there flat_map/set and stable_vector proposals at work?
From: Rob Stewart (robertstewart_at_[hidden])
Date: 2013-10-25 15:44:04


On Oct 25, 2013, at 2:00 PM, Nevin Liber <nevin_at_[hidden]> wrote:

> On 24 October 2013 17:10, Rob Stewart <robertstewart_at_[hidden]> wrote:
>
>> I meant that stack allocated memory could be used if std::array's interface satisfies the needs of flat_*. std::array can be one choice among
>> many.
>
> I'm not seeing how a container of exactly N elements would be useful as a backing store for flat_xxx. Could you show an example?

I was just thinking of a use case in which a map is needed, but memory is constrained or preallocated. I was also just showing how permitting user-specified containers opens possibilities.

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.

___
Rob

(Sent from my portable computation engine)


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