Test whether the sum of two integers would overflow.
Declared in <util/overflow.h>
template<std::integral T>
[[nodiscard]]
bool
AdditionOverflow(
T const i,
T const j) noexcept;
true if i + j would fall outside the representable range of T, false otherwise.
The return value should not be discarded.
| Name | Description |
|---|---|
| i | The first addend. |
| j | The second addend. |