Boost logo

Boost :

From: David Abrahams (dave_at_[hidden])
Date: 2003-03-27 10:00:47


scleary_at_[hidden] writes:

> Hey Jan -
>
> First off, let me say: excellent idea! Several times I've wanted just such
> a class, and I would be happy to see this added to Boost.
>
> I have a few suggestions/things to consider:
> 1) Instead of "operator bool", use the unspecified-bool-type discussed
> elsewhere on this list; it's safer.

Yup.

> 2) I'm not sure that the choice of the name is ideal. OTOH, I can't think
> of a better one...

lexicographic?

> 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);

??

Just one dumb idea for a comparison DSL...
-
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