Boost logo

Boost :

Subject: [boost] [container] templated find / [lower/upper]_bound would be really useful
From: Sebastian Karlsson (sebastian_at_[hidden])
Date: 2014-05-22 08:25:56


In my case I have map such as: flat_map< pair< TypeInfo, TypeInfo >, ... >,
TypeInfo being a wrapper around std::type_info. From this map I want to
find lower & upper bound of some TypeInfo in comparison to the first
TypeInfo of the pair. Since I can't know the maximum & minimum TypeInfo I
can't construct a key_type to search with. In this case it would be great
to be able to use find with a templated argument ( in my case I'd overload
the comparison for pair and smack in a TypeInfo for comparing against first
).

templated find / lower / upper would also have the benefit of being faster
if key_type is expensive to create. Overall I can't think of any major
downfalls, and the changes would seem to be rather easy to make.

Kind regards,
Sebastian Karlsson


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