[Issue 13179] AA key type TagIndex now requires equality rather than comparison
via Digitalmars-d-bugs
digitalmars-d-bugs at puremagic.com
Wed Jul 23 11:56:37 PDT 2014
https://issues.dlang.org/show_bug.cgi?id=13179
--- Comment #12 from hsteoh at quickfur.ath.cx ---
(In reply to Jonathan M Davis from comment #11)
[...]
> And code really shouldn't be calling opEquals or opCmp directly
> except under very rare circumstances. They're for generating overloaded
> operators, not for calling as normal functions.
Nobody is talking about calling opCmp or opEquals directly here. The issue here
is that == does not behave consistently with <, <=, >=, > when the user defines
opCmp (but not opEquals). Either we should *reject* such code (i.e., the user
must always explicitly define opEquals if opCmp is defined), or we should do
the Right Thing, that is, make opEquals the same as opCmp()==0.
--
More information about the Digitalmars-d-bugs
mailing list