Subtract j from i in place, only if it does not underflow.
Declared in <util/overflow.h>
template<
std::unsigned_integral T,
std::unsigned_integral U>
[[nodiscard]]
constexpr
bool
TrySub(
T& i,
U const j) noexcept;
true if i >= j and the subtraction was applied, false if it was left unchanged.
The return value should not be discarded.
| Name | Description |
|---|---|
| i | The minuend, updated to i - j when the subtraction succeeds. |
| j | The amount to subtract. |