Boost logo

Boost :

Subject: Re: [boost] [flat_set] When to sort?
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2017-04-08 10:59:41

On 08/04/2017 10:54, Joaquin M López Muñoz via Boost wrote:
> El 08/04/2017 a las 0:28, Ion Gaztañaga via Boost escribió:
>> Committed to develop new experimental functions:
>> class flat_map/set
>> {
>> sequence_type extract_sequence();
>> void adopt_sequence(sequence_type &&seq);
>> void adopt_sequence(ordered_unique_range_t, sequence_type &&seq);
>> };
> Shouldn't you also provide
> void adopt_sequence(unique_range_t, sequence_type &&seq);
> void adopt_sequence(ordered_range_t, sequence_type &&seq);
> for flat_map/set?

It looks a bit asymmetric against multi[set/map] containers which only
require ordered_unique (their own invariant). It's realistic that a user
that orders the sequence externally does not want to / can't erase
duplicates before calling the "risky" version of adopt_sequence?

I've modeled "adopt_sequence" constructors and "insert" members taking
unique_ranges. In those cases flat_set/map only supports
ordered_unique_range_t. We could add a new overload for all of them but
I just want to make sure they are needed.



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