Boost logo

Boost :

Subject: Re: [boost] [container] templated find / [lower/upper]_bound would be really useful
From: JOAQUIN M. LOPEZ MUÑOZ (joaquin_at_[hidden])
Date: 2014-05-22 11:52:42

Em 22/05/2014, às 14:26, "Sebastian Karlsson" <sebastian_at_[hidden]<mailto:sebastian_at_[hidden]>> escreveu:

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.

C++14 has a new feature precisely for this:

I'd file a ticket requesting that N3657 be applied to associative Boost containers.

Joaquín M López Muñoz


Este mensaje se dirige exclusivamente a su destinatario. Puede consultar nuestra política de envío y recepción de correo electrónico en el enlace situado más abajo.
This message is intended exclusively for its addressee. We only send and receive email on the basis of the terms set out at:

Boost list run by bdawes at, gregod at, cpdaniel at, john at