ProtoObject and comparison for equality and ordering
Mike Franklin
slavo5150 at yahoo.com
Tue May 14 21:06:05 UTC 2019
On Tuesday, 14 May 2019 at 20:36:08 UTC, Eduard Staniloiu wrote:
> Should `opCmp` return a float?
>
> The reason: when we attempt to compare two types that aren't
> comparable (an unordered relationship) we can return float.NaN.
> Thus we can differentiate between a valid -1, 0, 1 and an
> invalid float.NaN comparison.
Seems like a job for an enum, not a float or an integer.
Mike
More information about the Digitalmars-d
mailing list