WAT: opCmp and opEquals woes

Daniel Gibson via Digitalmars-d digitalmars-d at puremagic.com
Fri Jul 25 11:54:15 PDT 2014


Am 25.07.2014 18:11, schrieb "Marc Schütz" <schuetzm at gmx.net>":
> I'm astonished that it doesn't work like that already. When I first read
> the operator overloading docs, I really liked that in D I don't need to
> define all the individual comparison operators, but only opCmp. I

Well, to be fair the documentation, is pretty explicit about it, the 
headings are "Overloading == and !=" and "Overloading <, <=, <, and <=".
The D1 documentation even had a rationale why there's both opEquals and 
opCmp, no idea why that was dropped for D2.

However, I read about opCmp at some time and in the meantime forgot 
about the "not for ==" part - but this is probably a problem with my 
brain (or the long timespan) and not with the documentation.

Cheers,
Daniel


More information about the Digitalmars-d mailing list