Boost logo

Boost :

Subject: Re: [boost] [flat_set] When to sort?
From: Vladimir Batov (Vladimir.Batov_at_[hidden])
Date: 2017-03-27 20:27:29


On 03/28/2017 03:15 AM, Steven Watanabe via Boost wrote:
> AMDG
>
> On 03/26/2017 05:03 PM, Vladimir Batov via Boost wrote:
>> On 03/27/2017 09:20 AM, Andrey Semashev wrote:
>>> On Mon, Mar 27, 2017 at 12:01 AM, Vladimir Batov via Boost
>>>
>>>>> flat_set< int > fs;
>>>>> fs.reserve(5);
>>>>> fs.insert(10);
>>>>> auto it1 = fs.begin();
>>>>> auto it2 = fs.insert(42).first;
>>>>> auto it3 = f2.begin(); // invalidates it1 and it2
>>>> ...
> Invalidating it1 may be fine. Invalidating
> it2 is a definitely not okay.

Indeed, nits like the above convince me that taking an ordered vector
and calling it a set was probably a good-intentions-driven mistake. That
set-oriented mindset then influenced the set-like api and behavior too
much (IMO) that in turn affected the performance... the original goal of
the flat_set.


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