Boost logo

Boost :

Subject: Re: [boost] [flat_map] Any interest in a flat_map variant that is much faster on insertion/erase at the price of a slower lookup?
From: Mathias Gaunard (mathias.gaunard_at_[hidden])
Date: 2015-03-18 17:37:36

On 13/03/15 17:41, Phil Endecott wrote:
> Peter Dimov wrote:
>> Ion Gazta?aga wrote:
>>> El 13/03/2015 a las 14:38, Phil Endecott escribi?:
>>> > (Personally, I have a flat_map that does batched insertions i.e.
>>> the new > items are appended individually and then merged at the end
>>> of the batch. > This will have significant benefits for some workloads.)
>>> Yes, this should be added to flat_map. The interface won't be very
>>> pretty, but I would like to hear suggestions in this direction.
> I think we discussed this before. My preferred approach is
> flat_set S;
> {
> flat_set::batch b(S);
> b.insert(xxx);
> b.insert(yyy);
> } // b's dtor does the merge

How is that any different from the following?

flat_set S;
flat_set b;
S.insert_sorted(b.begin(), b.end());

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