WithNaN.hookOpBinaryRight

auto hookOpBinaryRight(string x, L, R)(L lhs, R rhs)

Defines hooks for binary operators `+`, `-`, `*`, `/`, `%`, `^^`, `&`, `|`, `^`, `<<`, `>>`, and `>>>` for cases where a Checked object is the right-hand side operand. If rhs == WithNaN.defaultValue!Rhs, returns

WithNaN.defaultValue!(typeof(lhs + rhs)) without evaluating the

operand. Otherwise, evaluates the operand. If evaluation does not overflow, returns the result. Otherwise, returns WithNaN.defaultValue!(typeof(lhs + rhs)).

Parameters

xThe operator symbol
lhsThe left-hand side operand
rhsThe right-hand side operand (Rhs is the first argument to Checked)

Returns

If rhs != WithNaN.defaultValue!Rhs and the operator does not

overflow, the function returns the same result as the built-in operator. In all other cases, returns WithNaN.defaultValue!(typeof(lhs + rhs)).