Boost logo

Boost :

Subject: Re: [boost] Proposal: Linear map
From: Andrey Semashev (andrey.semashev_at_[hidden])
Date: 2012-07-18 10:01:05


On Wednesday 18 July 2012 06:53:45 Amir Ansari wrote:
> boost::flat_map seems to provide exactly what I am looking for but there is
> one deal breaking caveat - it stores the key separately from the data. I
> don't know if this problem is already solved, but the way I see it, if the
> data needs the key for some other computation, we either need to replicate
> the key (memory usage) or take the computation out of the data class, which
> breaks encapsulation.
> Do you think it would make sense to have another container which simply uses
> the comparator to directly compare the objects being stored?

Does flat_set suit your requirements?


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