|
Boost : |
From: Jeremy Siek (jsiek_at_[hidden])
Date: 2000-11-25 10:48:22
On Sat, 25 Nov 2000, John Maddock wrote:
> >lower_bound(ForIter first, ForIter last, T value)
> >
> >The standard says T must be LessThanComparable. As I mentioned
> >before, this is somewhat irrelevant unless we also add the
> >requirement that iterator_traits<ForIter>::value_type is
> >the same type as T... but I don't think we want to add that.
>
> That isn't required: we only require that T be convertible to
> iterator_traits<ForIter>::value_type, if someone wants to add extra
> signatures to the comparison operator to avoid unnecessary coversions then
> that's OK, but I don't see LessThanComparable2<A,B> as being required here
> (although it can't do any harm).
The C++ standard also does not state that T must be convertible to
value_type.
So one way or another this needs to be fixed. One way to fix it is
to add the requirement for convertible, but that seems like an
indirect way to make things work. It would be much more direct
to use LessThanComparable2.
-Jeremy
----------------------------------------------------------------------
Jeremy Siek www: http://www.lsc.nd.edu/~jsiek/
Ph.D. Candidate email: jsiek_at_[hidden]
Univ. of Notre Dame work phone: (219) 631-3906
----------------------------------------------------------------------
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk