Defines a total order on all basic scalar values, using the same rules as std.math.cmp().
Direct comparisons between boolean values and numeric ones are forbidden. Make the intent explicit:
import checkedint.sticky : smartOp; // smartOp.cmp() never throws assert(smartOp.cmp(325.0, 325u) == 0); assert(smartOp.cmp(uint.max, -1) == 1); assert(smartOp.cmp(-3156, 300u) == -1);
See Implementation
Defines a total order on all basic scalar values, using the same rules as std.math.cmp().
Direct comparisons between boolean values and numeric ones are forbidden. Make the intent explicit: