Add two unsigned integers LHS and RHS.

Synopsis

Declared in <llvm/Support/CheckedArithmetic.h>

template<typename T>
std::optional<T>
checkedAddUnsigned(
    T LHS,
    T RHS)
requires std::is_unsigned_v<T>;

Return Value

Optional of sum if no unsigned overflow occurred, std::nullopt otherwise.

Parameters

Name

Description

LHS

Left‐hand operand of the sum.

RHS

Right‐hand operand of the sum.

Created with MrDocs