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-24 05:31:23

On Thu, Oct 24, 2013 at 11:16 AM, Rob Stewart <robertstewart_at_[hidden]>wrote:

> > Experience shows that having the implementation type as a parameter is
> rarely a good idea.
> > Having a vector as implementation is far enough for me right now but I
> don't really care as long as the flat_* behaviour and performance are
> > similar.
> Is that general experience, or just yours?
Both my experience and some I gathered online, so think more about my
That said, it's more about tradeof than just being a good or bad idea, I
guess if there is a performance benefit to it and it don't
make the implementation hard to follow, it would be a good idea.

> > I'm not sure what a deque would enable in this case.
> The same things deque offers over vector normally: VM-friendly allocations
> and growth at front and back without copying.
> If one reserves enough space up front, there's benefit in vector. If
> allocating on demand, deque can be better.

I see, but it depends a lot on the allocation pattern, so having the choice
would help fine tuning, which is your point if I understand correctly.

Boost list run by bdawes at, gregod at, cpdaniel at, john at