Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Member Functions | Friends | List of all members
base::internal::CheckedNumericState< T, NUMERIC_FLOATING > 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 (Src value)
 
template<typename Src >
constexpr CheckedNumericState (const CheckedNumericState< Src > &rhs)
 
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_FLOATING >

Definition at line 524 of file checked_math_impl.h.

Constructor & Destructor Documentation

◆ CheckedNumericState() [1/4]

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

Definition at line 544 of file checked_math_impl.h.

544: value_(0.0) {}

◆ CheckedNumericState() [2/4]

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

Definition at line 547 of file checked_math_impl.h.

548 : value_(WellDefinedConversionOrNaN(value, is_valid)) {}

◆ CheckedNumericState() [3/4]

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

Definition at line 551 of file checked_math_impl.h.

552 : value_(WellDefinedConversionOrNaN(
553 value,
554 IsValueInRangeForNumericType<T>(value))) {}

◆ CheckedNumericState() [4/4]

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

Definition at line 558 of file checked_math_impl.h.

559 : value_(WellDefinedConversionOrNaN(
560 rhs.value(),
561 rhs.is_valid() && IsValueInRangeForNumericType<T>(rhs.value()))) {}

Member Function Documentation

◆ is_valid()

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

Definition at line 563 of file checked_math_impl.h.

563 {
564 // Written this way because std::isfinite is not reliably constexpr.
565 return MustTreatAsConstexpr(value_)
566 ? value_ <= std::numeric_limits<T>::max() &&
567 value_ >= std::numeric_limits<T>::lowest()
568 : std::isfinite(value_);
569 }
constexpr bool MustTreatAsConstexpr(const T v)
SINT bool isfinite(const Vec< N, T > &v)
Definition SkVx.h:1003
Definition ref_ptr.h:256

◆ value()

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

Definition at line 570 of file checked_math_impl.h.

570{ return value_; }

Friends And Related Symbol Documentation

◆ CheckedNumericState

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

Definition at line 542 of file checked_math_impl.h.


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