
18 Jul
2012
18 Jul
'12
2:01 p.m.
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?