ProtoObject and comparison for equality and ordering

Adam D. Ruppe destructionator at gmail.com
Wed May 15 01:03:52 UTC 2019


So, going back to where the int/float/enum tangent started....

On Tuesday, 14 May 2019 at 20:36:08 UTC, Eduard Staniloiu wrote:
> interface Ordered(T)
> {
>     int opCmp(scope const T rhs);
> }
>
> Since we are here, I want to raise another question:
> Should `opCmp` return a float?


We'd then have two interfaces: Ordered!T, which returns the int, 
and then PartiallyOrdered!T that can return the float. You pick 
which one works best for your particular class.


More information about the Digitalmars-d mailing list