Boost logo

Boost :

From: Brian McNamara (lorgon_at_[hidden])
Date: 2003-08-29 22:49:13


> The point is, that Jan proposed to add something which has a hidden
> overhead and I'm not sure it's a good idea. Instead of nested
> if-else-cascades, the user could also write:
>
> bool operator<( const person& lhs, const person& rhs )
> {
> return
> lhs.lastname != rhs.lastname ? lhs.lastname < rhs.lastname :
> lhs.firstname != rhs.firstname ? lhs.firstname < rhs.firstname :
> lhs.age < rhs.age;
> }

I am (re)appearing mid-thread, so I may have missed something along the
way, but...

What's with "!="? I think lexicographical orderings are built only on
the assumptions of operator<, yes? For two objects x and y, if neither
   x < y
nor
   y < x
is true, then they are in the same equivalence class, but this is not
the same thing as equality or inequality.

I just want to make sure the template parameter constraints (or macro
parameter constraints, as the case may be) are the right ones.

-- 
-Brian McNamara (lorgon_at_[hidden])

Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk