Warn.onOverflow

typeof(~ Lhs()) onOverflow(string x, Lhs)(ref Lhs lhs)

Called automatically upon an overflow during a unary or binary operation.

Parameters

xThe operator involved
LhsThe first argument of Checked, e.g. int if the left-hand side of the operator is Checked!int
RhsThe right-hand side type involved in the operator

Returns

mixin(x ~ "lhs") for unary, mixin("lhs" ~ x ~ "rhs") for

binary

typeof(Lhs() + Rhs()) onOverflow(string x, Lhs, Rhs)(Lhs lhs, Rhs rhs)

ditto