Boost logo

Boost :

From: Kevlin Henney (kevlin_at_[hidden])
Date: 2000-11-21 12:49:47


In message <008101c053db$8efa85a0$3b0524d4_at_pdimov>, Peter Dimov
<pdimov_at_[hidden]> writes
>> Therefore, we end up with something more like this
>>
>> LessThanComparable2<A,B> (version 1)
>> A is LessThanComparable
>> B is LessThanComparable
>> A a; B b;
>> a < b
>> b < a
>>
>> I'm in favor of the above, though I could also see people arguing that if
>> "a < b" is a valid expression for the concept, then so should "b > a",
>> which would add the greater-than operator.
>>
>> LessThanComparable2<A,B> (version 2, with greater than)
>> A is LessThanComparable
>> B is LessThanComparable
>> A a; B b;
>> a < b
>> b < a
>> a > b
>> b > a
>>
>>
>> Anyone agree/disagree? Preferences between version 1 and 2?
>
>I agree with version 1.

Agreed. It does exactly what it says.

>None of my code requires the greater-than operator,
>so version 2 is overly restrictive. Besides, version 2 is not
>"LessThanComparable". :-)

Also agreed. It is LessThanAndGreaterThanComparable, and before you know
it scope creep will give you LessThanAndGreaterThanAndEqualityComparable
, etc :-}

Kevlin
____________________________________________________________

  Kevlin Henney phone: +44 117 942 2990
  Curbralan Limited mobile: +44 7801 073 508
  mailto:kevlin_at_[hidden] fax: +44 870 052 2289
  http://www.curbralan.com
____________________________________________________________


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