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; b.insert(xxx); b.insert(yyy); S.insert_sorted(b.begin(), b.end());