mp_units::utility::operator%

Computes the remainder of dividing lhs by rhs.

Synopsis

Declared in <mp-units/utility/safe_int.h>

[[nodiscard]]
constexpr
safe_int</* implementation-defined */, ErrorPolicy>
operator%(
    safe_int lhs,
    safe_int rhs);

Return Value

the remainder of lhs / rhs; triggers ErrorPolicy::on_overflow on modulo by zero

NOTE

The return value should not be discarded.

Parameters

NameDescription
lhsthe dividend
rhsthe divisor