Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-27 16:19:51


Jan Langer <jan_at_[hidden]> writes:

> David Abrahams wrote:
>>> 1) Instead of "operator bool", use the unspecified-bool-type discussed
>>>elsewhere on this list; it's safer.
>> Yup.
>
> ok, i changed it.
>
>>> 2) I'm not sure that the choice of the name is ideal. OTOH, I can't think
>>>of a better one...
>> lexicographic?
>
> i dont bother about the name. if this is better i will change it.

I don't really like it, FWIW.

>>> 3) I'd like to see a general solution for this problem using real
>>>(late-bound) function objects as well, if you know what I mean. This would
>>>be a lot harder, though, so maybe it should be put on a wish-list. Have you
>>>given any thought to this approach?
>> return compare.less(p1.x, p2.x)
>> .greater(p1.y, p2.y)
>> .call(f, p1.z, p2.z);
>
> now this would be:
>
> return compare (p1.x, p2.x, std::less <double> ())
> (p1.y, p2.y, std::greater <double> ())
> (p1.z, p2.z, f);

The problem with that is that it requires you to name the type of the
arguments (and they have to be the same).

> or nearly the same:
>
> return compare (p1.x, p2.x)
> (p2.y, p1.y)
> (p1.z, p2.z, f);

Maybe that's better.

-- 
Dave Abrahams
Boost Consulting
www.boost-consulting.com

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