WAT: opCmp and opEquals woes

Fool via Digitalmars-d digitalmars-d at puremagic.com
Sat Jul 26 03:22:52 PDT 2014


I agree that the documentation needs improvement.

It needs to be defined what kind of relation opCmp is meant to 
model.

If it's concept is a partial order, opEquals cannot be inferred.

If it's concept is a strict weak ordering [1, 2], which is 
required for sorting, opEqual can be inferred.

[1] https://www.sgi.com/tech/stl/StrictWeakOrdering.html
[2] 
https://en.wikipedia.org/wiki/Weak_ordering#Strict_weak_orderings


More information about the Digitalmars-d mailing list