opCmp and opEquals woes

Manu via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 25 05:15:44 PDT 2014


On 25 July 2014 22:06, Jacob Carlborg via Digitalmars-d <
digitalmars-d at puremagic.com> wrote:

> On 25/07/14 12:39, Jonathan M Davis wrote:
>
>  But regardless of whether the efficiency cost is large, you're talking
>> about incurring it just to fix the code of folks who couldn't be
>> bothered to make sure that opEquals and lhs.opCmp(rhs) == 0 were
>> equivalent. You'd be punishing correct code (however slight that
>> punishment may be) in order to fix the code of folks who didn't even
>> properly test basic functionality. I see no reason to care about trying
>> to help out folks who can't even be bothered to test opEquals and opCmp,
>> especially when that help isn't free.
>>
>
> By Walter and Andrei's definition opCmp is not to be used for equivalent,
> therefor opCmp does never need to be equal to 0.


Yes it does, <= and >= are both things that you can type.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20140725/80ab8e96/attachment.html>


More information about the Digitalmars-d mailing list