Boost logo

Boost :

Subject: [boost] [container] moving a pre-built vector into a flat_set
From: Sam Kellett (samkellett_at_[hidden])
Date: 2015-09-15 17:03:43


a common problem i encounter is that i have two stage's w/r/t to a large
collection of data: building and querying.

vector is obviously the king of building. flat_set is the king of querying.
so what i often tend to do is build up a very large vector, sort it then
create a flat_set using the flat_set(ordered_unique_t) constructor.

however this still copies the entire vector into the flat_set, right?

what i would like to be able to do is move the vector straight into the
flat_set, something like:

std::vector<T> data;

flat_set data_set1(std::move(data)) // move vector in and sort it
// or:
std::sort(data.begin(), data.end()); // sort vector
flat_set data_set2(ordered_unique_t, std::move(data)) // and move it in

is this doable (am i just being blind?) or is there plans/interest for this?


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