Checked.opBinary

auto opBinary(string op, Rhs)(const Rhs rhs) if (isIntegral!Rhs || isFloatingPoint!Rhs || is(Rhs == bool))

Defines binary operators `+`, `-`, `*`, `/`, `%`, `^^`, `&`, `|`, `^`, `<<`, `>>`, and `>>>`. If Hook defines hookOpBinary, opBinary forwards to Checked!(typeof(hook.hookOpBinary!op(get, rhs)), Hook)(hook.hookOpBinary!op(get, rhs)).

If Hook does not define hookOpBinary but defines onOverflow, opBinary forwards to hook.onOverflow!op(get, rhs) in case an overflow occurs.

If two Checked instances are involved in a binary operation and both define hookOpBinary, the left-hand side hook has priority. If both define onOverflow, a compile-time error occurs.

Parameters

opThe binary operator
rhsThe right hand side operand
UIf rhs is a Checked instance, U represents the underlying instance type
Hook1If rhs is a Checked instance, Hook1 represents the instance's behavior hook

Returns

A Checked instance representing the result of the binary

operation

auto opBinary(string op, Rhs)(const Rhs rhs) if (isIntegral!Rhs || isFloatingPoint!Rhs || is(Rhs == bool)) const

ditto

auto opBinary(string op, U, Hook1)(Checked!(U, Hook1) rhs)

ditto

auto opBinary(string op, U, Hook1)(Checked!(U, Hook1) rhs) const

ditto