Boost logo

Boost :

Subject: Re: [boost] [containers] Are there flat_map/set and stable_vector proposals at work?
From: Klaim - Joël Lamotte (mjklaim_at_[hidden])
Date: 2013-10-25 15:49:49


On Fri, Oct 25, 2013 at 9:44 PM, Rob Stewart <robertstewart_at_[hidden]>wrote:

> 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.

But then it would make the flat_map semantic changes because it have
runtime-fixed-size and it makes it not inter-changeable, wouldn't it?
That being said it would be the same as to have a pool allocator I guess.

Anyway, I still have no answer as to if there is a proposal work in
progress or not.


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