|
Boost : |
Subject: Re: [boost] [flat_set] When to sort?
From: Oswin Krause (Oswin.Krause_at_[hidden])
Date: 2017-04-07 23:38:38
On 2017-04-08 00:28, Ion Gaztañaga via Boost wrote:
> On 29/03/2017 4:13, Chris Glover via Boost wrote:
>> We can have different "adopt" variants depending on the guarantees the
>> user provides, just like we have different "insert" versions
>> (ordered_unique_t, etc.). The "safe" one can assume passed vector is
>> unordered and just sorts and calls unique if needed. Other variants
>> might just skip sorting if the user requires so.
>>
>>
>> Sure.
>
> 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);
> };
>
> class flat_multimap/multiset
> {
> sequence_type extract_sequence();
> void adopt_sequence(sequence_type &&seq);
> void adopt_sequence(ordered_range_t, sequence_type &&seq);
> };
>
> Let's see if they are useful. Any feedback welcome.
The returned sequence should be a r value reference to reduce costs of
extract, modify, adopt patterns.
>
> Ion
>
> _______________________________________________
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk