|
Boost : |
From: David Bergman (davidb_at_[hidden])
Date: 2002-09-06 10:14:09
Peter,
The first argument, of being "STL-compatible" is reasonable, the second
is not. I argue that the user should be aware that he is dealing with a
partial order (if the order is such, such as '<' being subset) when
coding, so, yes, he might be forced to change the logic (in this case
control flow) when going from a total to a partial order...
/David
-----Original Message-----
From: boost-bounces_at_[hidden]
[mailto:boost-bounces_at_[hidden]] On Behalf Of Peter Dimov
Sent: Friday, September 06, 2002 8:34 AM
To: boost_at_[hidden]
Subject: Re: [boost] Interval Library and comparison operators
From: "David Bergman" <davidb_at_[hidden]>
>
> BUT, the prime reason for keeping the STL convenience implementation
> of '<=' being '!>' was in order to be "compatible" with STL, according
> to Herve and Guillaume, in spite of the induced "equivalence" not
> being an equivalence at all. Thus, I somehow got the idea that it was
> important.
Having an "STL-compatible" operator< is important if you want to use STL
algorithms or associative containers with intervals without an explicit
comparator.
Having operator<= that is !> is important if you want to prevent user
mistakes, such as replacing
if(!(x < y))
with
if(y >= x)
There is always the option of not defining <= at all.
_______________________________________________
Unsubscribe & other changes:
http://lists.boost.org/mailman/listinfo.cgi/boost
Boost list run by bdawes at acm.org, gregod at cs.rpi.edu, cpdaniel at pacbell.net, john at johnmaddock.co.uk