# Boost :

From: Joe Gottman (joegottman_at_[hidden])
Date: 2000-02-28 19:38:17

----- Original Message -----
From: <scleary_at_[hidden]>
To: <boost_at_[hidden]>
Sent: Monday, February 28, 2000 10:28 AM
Subject: [boost] Re: shared_ptr: operator<

> joe gottman wrote:
> > Braden N. McDaniel wrote:
> > > Okay, silly question time: What exactly is meant here by the term
> "total
> > > order"?
> > >
> >
> > An ordering relation such that for every pair of elements x and y,
> > exactly one of the following statements is true: x < y, x == y, x > y.
> >
>
> Sorry to be so nitpicky, but this isn't quite true. The definition
> above is for a strict weak ordering. Total ordering implies that for
> each different pair of elements: (x < y) || (x > y); it does _not_
> allow them to be equal. This means that x != y for all y. Remember
> that these restrictions are on the _values_ of the pointers, not the
> pointers themselves; so two different values of pointers cannot ever
> compare equal (of course), but two different pointers can compare equal
> (if they have the same value).

When I said "pair" above, I did not mean "distinct pair". (x, x) is a
perfectly reasonable pair, and I'm sure you will agree that neither x < x
nor x > x is true. My definition of "total ordering" comes from the book
_Basic Algebra I_ by Nathan Jacobson. It defines a total order as a partial
order such that for any two objects x and y, x <= y or y <= x. This is
equivalent to the definition I gave if we define
x < y iff !(y <= x)
x == y iff (x <= y) && (y <= x)
x > y iff !(x <= y)

Joe Gottman