LLVM 24.0.0git
llvm::detail::CheckedInt Struct Reference

#include "llvm/ADT/Sequence.h"

Public Member Functions

constexpr bool operator== (const CheckedInt &O) const
constexpr bool operator!= (const CheckedInt &O) const
constexpr CheckedInt operator+ (intmax_t Offset) const
constexpr intmax_t operator- (CheckedInt Other) const
template<typename Integral, std::enable_if_t< std::is_integral< Integral >::value, bool > = 0>
constexpr Integral to () const
template<typename Enum, std::enable_if_t< std::is_enum< Enum >::value, bool > = 0>
constexpr Enum to () const

Static Public Member Functions

template<typename Integral, std::enable_if_t< std::is_integral< Integral >::value, bool > = 0>
static constexpr CheckedInt from (Integral FromValue)
template<typename Enum, std::enable_if_t< std::is_enum< Enum >::value, bool > = 0>
static constexpr CheckedInt from (Enum FromValue)

Detailed Description

Definition at line 129 of file Sequence.h.

Member Function Documentation

◆ from() [1/2]

template<typename Enum, std::enable_if_t< std::is_enum< Enum >::value, bool > = 0>
constexpr CheckedInt llvm::detail::CheckedInt::from ( Enum FromValue)
inlinestaticconstexpr

Definition at line 144 of file Sequence.h.

References from(), and llvm::to_underlying().

◆ from() [2/2]

template<typename Integral, std::enable_if_t< std::is_integral< Integral >::value, bool > = 0>
constexpr CheckedInt llvm::detail::CheckedInt::from ( Integral FromValue)
inlinestaticconstexpr

Definition at line 133 of file Sequence.h.

References llvm::detail::canTypeFitValue().

Referenced by from(), and operator+().

◆ operator!=()

bool llvm::detail::CheckedInt::operator!= ( const CheckedInt & O) const
inlineconstexpr

Definition at line 152 of file Sequence.h.

◆ operator+()

CheckedInt llvm::detail::CheckedInt::operator+ ( intmax_t Offset) const
inlineconstexpr

Definition at line 156 of file Sequence.h.

References llvm::AddOverflow(), from(), and llvm::Offset.

◆ operator-()

intmax_t llvm::detail::CheckedInt::operator- ( CheckedInt Other) const
inlineconstexpr

Definition at line 163 of file Sequence.h.

References llvm::Other, and llvm::SubOverflow().

◆ operator==()

bool llvm::detail::CheckedInt::operator== ( const CheckedInt & O) const
inlineconstexpr

Definition at line 149 of file Sequence.h.

◆ to() [1/2]

template<typename Integral, std::enable_if_t< std::is_integral< Integral >::value, bool > = 0>
Integral llvm::detail::CheckedInt::to ( ) const
inlineconstexpr

Definition at line 173 of file Sequence.h.

References llvm::detail::canTypeFitValue().

Referenced by to().

◆ to() [2/2]

template<typename Enum, std::enable_if_t< std::is_enum< Enum >::value, bool > = 0>
Enum llvm::detail::CheckedInt::to ( ) const
inlineconstexpr

Definition at line 183 of file Sequence.h.

References to().


The documentation for this struct was generated from the following file: