Boost logo

Boost :

From: Guillaume Melquiond (gmelquio_at_[hidden])
Date: 2002-09-06 15:07:16

On Fri, 6 Sep 2002, David Bergman wrote:

> Guillaume,
> One often attaches semantics to the syntactical operators. The semantics
> one attaches to '<' is usually a relation, which has nothing to do with
> tribool comparisons. So, either a pair belongs to this relation or not.
> You want it to denote a non-relation.
> I agree with Fernando in that if the user wants to fetch the
> indeterminate case, he/she cannot use a binary relation.
> You want '<' to denote a function to a a 3-space, which is not obvious
> for a user, IMEHO.
> So, we seem to be torn by two counter-intuitive extremes: (1) defining
> '<' not as a relation, but as a binary function into a 3-space and (2)
> using a "unnatural" total ordering (e.g., lexicographic) for '<'.
> Which extreme do you prefer?
> My bias is clear, (2), with a proper disclaimer.
> /David

I personally don't have any opinion on this question, since I don't
use comparison operators in my code but only explicit comparison
functions. :-)

More seriously, this is one of the reason why there is a comparison
policy. Various users may have various needs. There is actually four
pre-defined comparison policies: compare_certainly and compare_possibly
define a real binary relation; compare_full allows to handle a 3-state
comparison (especially if the user could set the return type in the
policy); and compare_data is the lexicographic order. And obviously, there
are all the customized comparison policies an user could imagine.

It's why I think the current policy-based comparison system is a good
one. And maybe the main question is: what should be the default


(happy to see that all the comparison problems seems to come to an end)

Boost list run by bdawes at, gregod at, cpdaniel at, john at