On Oct 23, 2013, at 11:57 AM, Klaim - Joël Lamotte
On Wed, Oct 23, 2013 at 5:07 PM, TONGARI J
wrote: I wonder if we can choose the underlying container for flat_xxx, for example, use deque instead of vector. Or would it be better to make them as adaptors?
That would be a different question for the container implementor.
It can, and possibly should, be in the hands of the user. After all, one selects flat_map over map, for example, for performance reasons.
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?
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. ___ Rob (Sent from my portable computation engine)