Boost logo

Boost :

From: David Abrahams (abrahams_at_[hidden])
Date: 2001-01-20 15:34:09


----- Original Message -----
From: "Jeremy Siek" <jsiek_at_[hidden]>
> gseidm> Also, std::lower_bound requires that its value (or
> gseidm> LessThanComparable, depending on which overloaded version
> gseidm> one uses) argument, of arbitrary type T, be the same type
> gseidm> as *ForwardIterator; this seems logical, until you realize
> gseidm> that one can define either an op< or a StrictWeakOrdering
> gseidm> functor which takes heterogeneous arguments and expect it
> gseidm> to work just fine.
>
> Yes, I'm aware of this problem. The problem is partially my fault, and
> partially a problem in the standard. There are people working on the
> solution for this, but it is non-trivial to fix.

In particular, look at http://www.egroups.com/files/boost/Binary+Search/,
which attempts to solve the problem. If you use boost::lower_bound() from
this library, you won't be subject to the same constraints. It /does/
require the prior installation of boost, but that's pretty trivial (just
unpack it somewhere and put the top-level directory in your include path).

-Dave


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