Checked.opCmp

auto opCmp(U, this _)(const U rhs) if (isIntegral!U || isFloatingPoint!U || is(U == bool))

Compares this against rhs for ordering. If Hook defines hookOpCmp, the function forwards to hook.hookOpCmp(get, rhs). Otherwise, the result of the built-in comparison operation is returned.

If U is also an instance of Checked, both hooks (left- and right-hand side) are introspected for the method hookOpCmp. If both define it, priority is given to the left-hand side.

Parameters

rhsThe right-hand side operand
Ueither the type of rhs or the underlying type if rhs is a Checked instance
Hook1If rhs is a Checked instance, Hook1 represents the instance's behavior hook

Returns

The result of hookOpCmp if hook defines hookOpCmp. If

U is an instance of Checked and hook does not define hookOpCmp, result of rhs.hook.hookOpCmp is returned. If none of the instances specify the behavior via hookOpCmp, -1 is returned if lhs is lesser than rhs, 1 if lhs is greater than rhs and 0 on equality.

auto opCmp(U, Hook1, this _)(Checked!(U, Hook1) rhs)

ditto