|
Boost : |
Subject: [boost] [containers] Templated map::find?
From: Lars Viklund (zao_at_[hidden])
Date: 2011-08-22 07:37:43
Hi list.
I was asked today why the std::map container didn't have templated
versions of functions like find, lower_bound, and so on. I could not
give a good answer on why there could not exist such a thing, assuming
that the comparator had sufficient symmetric overloads for the real Key
type and the FauxKey that the query would be performed with.
Would something like this be possible to add to Boost.Containers,
considering that going through the typical standard routes would have a
latency of a couple years at best? I'm told that the Boost.Intrusive
containers already supports this.
Some use cases would be querying with a type that's convertible (in an
expensive way) to the held key type, or querying with a key type that
has only the fields that affect ordering in the case of a rich key type.
-- Lars Viklund | zao_at_[hidden]
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk