|
Boost : |
From: Dirk Gerrits (dirk_at_[hidden])
Date: 2002-11-26 11:29:54
David Abrahams wrote:
> Ben Young writes:
>
>
> >On Mon, 25 Nov 2002, David Abrahams wrote:
> >
> >
> >>Ben Young writes:
> >>
> >>
> >>>Recently at our company we had a couple of bugs relating to people
> >>>incorrectly writing comparison operators, so I came up with this little
> >>>helper. It is very trivial, but useful none the less as bogus
> comparison
> >>>operators can be the cause of many bugs.
> >>>
> >>>Obviously it could be improved to take a predictate of some kind and
> >>>checged to use the boost pre-processor library, but, otherwise, is
> anyone
> >>>interested
> >>
> >>Did you ever consider using
> >>
> >> make_tuple(x1, y1, z1) < make_tuple(x2, y2, z2)
> >>
> >>?
> >
> >Yes, but actually I am of the feeling that perhaps the tuple library
> >should be using the strict_... form rather than the other way around.
> >
> >Won't the make_tuple method make a copy of all its arguments?
>
>
> OK:
>
> make_tuple(ref(x1), ref(y1), ref(z1)) < ...
Isn't this equivalent to
tie(x1, y1, z1) < tie(x2, y2, z2)
?
> Anyway, in the past I have needed/wanted the strict_... function
> family you propose, but:
>
> 1. I would call it lexicographic_ordering
I agree.
Dirk Gerrits
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk