> -----Original Message-----
> From: David Abrahams [mailto:[EMAIL PROTECTED]
> 
> [EMAIL PROTECTED] writes:
> 
> >   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);
> 
> ??

Sorry, I wasn't very clear.  I mean defining a compare_t that could be used
something like:

compare_t<&position::x, &position::y, &position::z>

that would result in a function object type that produced the same behaviour
when given two arguments of type 'position'.  (Usable, e.g., as a template
argument to std::set).  I don't see any way of supporting that simple of a
syntax, though; the nicest I can see is:

compare_type<position, compare_t<double, &position::x>,
    compare_t<double, &position::y>, compare_t<double, &position::z> >

which is pretty hideous. :(

        -Steve
_______________________________________________
Unsubscribe & other changes: http://lists.boost.org/mailman/listinfo.cgi/boost

Reply via email to