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
_______________________________________________