import checkedint.sticky : smartOp; // smartOp.cmp() never throws
assert(uint.max == -1);
assert( smartOp.cmp!"!="(uint.max, -1));
assert(-3156 > 300u);
assert( smartOp.cmp!"<"(-3156, 300u));
assert(!smartOp.cmp!"<"(1, real.nan));
assert(!smartOp.cmp!"<"(real.nan, 1));
Compare left and right using op.
Direct comparisons between boolean values and numeric ones are forbidden. Make the intent explicit: