opCmp and opEquals woes

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 25 13:53:24 PDT 2014


On 7/25/2014 5:15 AM, Manu via Digitalmars-d wrote:
> On 25 July 2014 22:06, Jacob Carlborg via Digitalmars-d
>     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.

Incorrect, as an object may not even have a notion of equality. Nothing requires 
opCmp to ever return 0.

Of course, such an opCmp would never have worked with AAs anyway.



More information about the Digitalmars-d mailing list