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: Phil Endecott (spam_from_boost_dev_at_[hidden])
Date: 2015-04-08 05:40:02


Giacomo Drago wrote:
> On 2015-03-24 19:32, Phil Endecott wrote:
>> Another way to get the same saving would be to have N normal
>> flat_maps (where N is e.g. 2 or 3). Insert into whichever is
>> currently smallest, and lookup in both. That has the same
>> typical and worst-case complexity as a flat_map, but you can
>> trade off (by constant factors) the cost of insertion vs. the
>> cost of lookup and iteration by adjusting N.
>
> This is simple and brilliant, and can help me with the actual scenario I
> am dealing with. Do you mind if I use this idea, and I appropriately
> mention you?

You're welcome, and there is no need for any attribution.

Regards, Phil.


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