llvm::checkedMul

Multiply two signed integers LHS and RHS.

Synopsis

Declared in <llvm/Support/CheckedArithmetic.h>

template<typename T>
std::optional<T>
checkedMul(
    T LHS,
    T RHS)
requires std::is_signed_v<T>;

Return Value

Optional of product if no signed overflow occurred, std::nullopt otherwise.

Parameters

NameDescription
LHSLeft-hand operand of the product.
RHSRight-hand operand of the product.