SubOverflow overloads

Synopses

Declared in <llvm/Support/MathExtras.h>

Subtract two signed integers with overflow detection.

template<typename T>
constexpr
std::pair<T, bool>
SubOverflow(
    T X,
    T Y)
requires std::is_signed_v<T>;

Subtract two signed integers, returning true if an overflow occurred.

template<typename T>
T
SubOverflow(
    T X,
    T Y,
    T& Result)
requires std::is_signed_v<T>;

Return Value

  • A pair of the truncated difference and whether overflow occurred.

  • True if overflow occurred.

Parameters

Name

Description

X

Minuend.

Y

Subtrahend.

Result

Set to the truncated difference.

Created with MrDocs