opCmp / opEquals do not actually support partial orders
Jonathan M Davis
newsgroup.d at jmdavisprog.com
Wed Jul 18 17:30:21 UTC 2018
On Tuesday, July 17, 2018 21:18:12 John Colvin via Digitalmars-d wrote:
> Just do what std.typecons.Proxy does and return float.nan for the
> incomparable case.
Since when is that legal? I thought that it was required for opCmp to return
int. Certainly, the spec implies that it has to be int. The fact that the
compiler allows it seems like a bug, though if Phobos is doing it, it
wouldn't surprise me if Walter would choose to update the spec rather than
fixing the compiler.
- Jonathan M Davis
More information about the Digitalmars-d
mailing list