On Saturday, 26 July 2014 at 09:48:55 UTC, Andrei Alexandrescu wrote:
On 7/26/14, 2:19 AM, "Marc Schütz" <schue...@gmx.net>" wrote:
Yes, that's why it's possible to provide opEquals in addition to opCmp.

Not quite, opCmp would then have to throw if opCmp(a,b) is incomparable. Conflating incomparable and equal values as 0 is a bad idea when sorting. That means incomparable values are sprinkled randomly over the sort.

Case-insensitive ordering is a simple example.

That doesn't sound right. "<=" is defined for all possible pairs. Case insensitive ordering satisfies the totality requirement: (a <= b or b <= a), for all strings a and b?

Reply via email to