Flutter Engine
The Flutter Engine
Public Member Functions | Friends | List of all members
base::internal::CheckedNumericState< T, NUMERIC_INTEGER > Class Template Reference

#include <checked_math_impl.h>

Public Member Functions

constexpr CheckedNumericState ()
 
template<typename Src >
constexpr CheckedNumericState (Src value, bool is_valid)
 
template<typename Src >
constexpr CheckedNumericState (const CheckedNumericState< Src > &rhs)
 
template<typename Src >
constexpr CheckedNumericState (Src value)
 
constexpr bool is_valid () const
 
constexpr T value () const
 

Friends

template<typename Src , NumericRepresentation type>
class CheckedNumericState
 

Detailed Description

template<typename T>
class base::internal::CheckedNumericState< T, NUMERIC_INTEGER >

Definition at line 476 of file checked_math_impl.h.

Constructor & Destructor Documentation

◆ CheckedNumericState() [1/4]

template<typename T >
constexpr base::internal::CheckedNumericState< T, NUMERIC_INTEGER >::CheckedNumericState ( )
inlineconstexpr

Definition at line 498 of file checked_math_impl.h.

498: is_valid_(true), value_(0) {}

◆ CheckedNumericState() [2/4]

template<typename T >
template<typename Src >
constexpr base::internal::CheckedNumericState< T, NUMERIC_INTEGER >::CheckedNumericState ( Src  value,
bool  is_valid 
)
inlineconstexpr

Definition at line 501 of file checked_math_impl.h.

502 : is_valid_(is_valid && IsValueInRangeForNumericType<T>(value)),
503 value_(WellDefinedConversionOrZero(value, is_valid_)) {
504 static_assert(std::is_arithmetic<Src>::value, "Argument must be numeric.");
505 }
uint8_t value

◆ CheckedNumericState() [3/4]

template<typename T >
template<typename Src >
constexpr base::internal::CheckedNumericState< T, NUMERIC_INTEGER >::CheckedNumericState ( const CheckedNumericState< Src > &  rhs)
inlineconstexpr

Definition at line 509 of file checked_math_impl.h.

510 : is_valid_(rhs.IsValid()),
511 value_(WellDefinedConversionOrZero(rhs.value(), is_valid_)) {}

◆ CheckedNumericState() [4/4]

template<typename T >
template<typename Src >
constexpr base::internal::CheckedNumericState< T, NUMERIC_INTEGER >::CheckedNumericState ( Src  value)
inlineexplicitconstexpr

Definition at line 514 of file checked_math_impl.h.

515 : is_valid_(IsValueInRangeForNumericType<T>(value)),
516 value_(WellDefinedConversionOrZero(value, is_valid_)) {}

Member Function Documentation

◆ is_valid()

template<typename T >
constexpr bool base::internal::CheckedNumericState< T, NUMERIC_INTEGER >::is_valid ( ) const
inlineconstexpr

Definition at line 518 of file checked_math_impl.h.

518{ return is_valid_; }

◆ value()

template<typename T >
constexpr T base::internal::CheckedNumericState< T, NUMERIC_INTEGER >::value ( ) const
inlineconstexpr

Definition at line 519 of file checked_math_impl.h.

519{ return value_; }

Friends And Related Function Documentation

◆ CheckedNumericState

template<typename T >
template<typename Src , NumericRepresentation type>
friend class CheckedNumericState
friend

Definition at line 496 of file checked_math_impl.h.


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