|
Boost : |
Subject: Re: [boost] Proposal: Linear map
From: Amir Ansari (amir.ansari80_at_[hidden])
Date: 2012-07-18 10:40:17
Thanks. This is exactly what I was looking for. Some questions:
1. Is there any container that allows inserting without providing a value of the contained type, but rather, some other type? Essentially, it would rely on a non-default constructor that takes the other type as input.
2. Is there some specialization for flat_set with the same semantics as ptr_vector ?
________________________________
From: Andrey Semashev <andrey.semashev_at_[hidden]>
To: boost_at_[hidden]
Sent: Wednesday, July 18, 2012 7:01 PM
Subject: Re: [boost] Proposal: Linear map
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?
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk