WAT: opCmp and opEquals woes

Fool via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 27 13:54:03 PDT 2014


On Sunday, 27 July 2014 at 20:45:25 UTC, Ola Fosheim Grøstad 
wrote:
> On Sunday, 27 July 2014 at 19:04:09 UTC, Fool wrote:
>> If a candidate for opCmp does not match the default 
>> equivalence relation == (defined implicitly or explicitly 
>> specified using opEquals) it should not be defined at all.
>
> Does this mean that you agree that opCmp should define a total 
> order?

I think that it should be documented to require properties of a 
strict partial order (irreflexivity and transitivity, and thus 
asymmetry) and recommended to model a strict weak order such that 
(stable) sorting is defined.


More information about the Digitalmars-d mailing list