Boost logo

Boost :

Subject: Re: [boost] [flat_set] When to sort?
From: Ion Gaztañaga (igaztanaga_at_[hidden])
Date: 2017-04-07 22:28:42


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.

Ion


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