Boost logo

Boost :

Subject: Re: [boost] [container] moving a pre-built vector into a flat_set
From: Sam Kellett (samkellett_at_[hidden])
Date: 2015-09-16 08:13:32


>
> > [snip]
>
>
>
> how come? i get that it's exposing the implementation, but the gains would
> > be so so massive. and the name flat_ basically confirms the use of a
> sorted
> > vector internally.
>
> Moving in a std::vector would force the flat_set to be implemented in
> terms of a
> std::vector. However, what about a type from flat_set, e.g.
> flat_set<T>::storage
> and document what concept this storage implements (e.g. Random Access
> Container), and then we could do what you want in a maybe cleaner way.
>
> flat_set<T>::storage data;
> // fill data
> flat_set<T> the_set{std::move(data)};
>

yeah that would be perfect!


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