v8
V8 is Google’s open source high-performance JavaScript and WebAssembly engine, written in C++.
Loading...
Searching...
No Matches
v8::base::internal::CheckedNumeric< T > Class Template Reference

#include <checked_math.h>

Collaboration diagram for v8::base::internal::CheckedNumeric< T >:

Classes

struct  Wrapper
 
struct  Wrapper< CheckedNumeric< Src > >
 
struct  Wrapper< StrictNumeric< Src > >
 

Public Types

using type = T
 

Public Member Functions

constexpr CheckedNumeric ()=default
 
template<typename Src >
constexpr CheckedNumeric (const CheckedNumeric< Src > &rhs)
 
template<typename Src >
requires (std::is_arithmetic_v<Src>)
constexpr CheckedNumeric (Src value)
 
template<typename Src >
constexpr CheckedNumeric (StrictNumeric< Src > value)
 
template<typename Dst = T>
constexpr bool IsValid () const
 
template<typename Dst >
constexpr bool AssignIfValid (Dst *result) const
 
template<typename Dst = T, class CheckHandler = CheckOnFailure>
constexpr StrictNumeric< Dst > ValueOrDie () const
 
template<typename Dst = T, typename Src >
constexpr StrictNumeric< Dst > ValueOrDefault (Src default_value) const
 
template<typename Dst >
constexpr CheckedNumeric< UnderlyingType< Dst > > Cast () const
 
template<typename Src >
constexpr CheckedNumericoperator+= (const Src rhs)
 
template<typename Src >
constexpr CheckedNumericoperator-= (const Src rhs)
 
template<typename Src >
constexpr CheckedNumericoperator*= (const Src rhs)
 
template<typename Src >
constexpr CheckedNumericoperator/= (const Src rhs)
 
template<typename Src >
constexpr CheckedNumericoperator%= (const Src rhs)
 
template<typename Src >
constexpr CheckedNumericoperator<<= (const Src rhs)
 
template<typename Src >
constexpr CheckedNumericoperator>>= (const Src rhs)
 
template<typename Src >
constexpr CheckedNumericoperator&= (const Src rhs)
 
template<typename Src >
constexpr CheckedNumericoperator|= (const Src rhs)
 
template<typename Src >
constexpr CheckedNumericoperator^= (const Src rhs)
 
constexpr CheckedNumeric operator- () const
 
constexpr CheckedNumeric operator~ () const
 
constexpr CheckedNumeric Abs () const
 
template<typename U >
constexpr CheckedNumeric< typename MathWrapper< CheckedMaxOp, T, U >::typeMax (U rhs) const
 
template<typename U >
constexpr CheckedNumeric< typename MathWrapper< CheckedMinOp, T, U >::typeMin (U rhs) const
 
constexpr CheckedNumeric< typename UnsignedOrFloatForSize< T >::typeUnsignedAbs () const
 
constexpr CheckedNumericoperator++ ()
 
constexpr CheckedNumeric operator++ (int)
 
constexpr CheckedNumericoperator-- ()
 
constexpr CheckedNumeric operator-- (int)
 
template<template< typename, typename > class M, typename R >
constexpr CheckedNumericMathOp (R rhs)
 

Static Public Member Functions

template<template< typename, typename > class M, typename L , typename R >
static constexpr CheckedNumeric MathOp (L lhs, R rhs)
 

Private Member Functions

CheckedNumeric FastRuntimeNegate () const
 
template<typename Src >
constexpr CheckedNumeric (Src value, bool is_valid)
 

Private Attributes

CheckedNumericState< Tstate_
 

Friends

template<typename U >
class CheckedNumeric
 
template<typename U >
GetNumericValueForTest (const CheckedNumeric< U > &src)
 

Detailed Description

template<typename T>
requires std::is_arithmetic_v<T>
class v8::base::internal::CheckedNumeric< T >

Definition at line 485 of file safe_conversions_impl.h.

Member Typedef Documentation

◆ type

template<typename T >
using v8::base::internal::CheckedNumeric< T >::type = T

Definition at line 27 of file checked_math.h.

Constructor & Destructor Documentation

◆ CheckedNumeric() [1/5]

template<typename T >
v8::base::internal::CheckedNumeric< T >::CheckedNumeric ( )
constexprdefault

◆ CheckedNumeric() [2/5]

template<typename T >
template<typename Src >
v8::base::internal::CheckedNumeric< T >::CheckedNumeric ( const CheckedNumeric< Src > & rhs)
inlineconstexpr

Definition at line 33 of file checked_math.h.

◆ CheckedNumeric() [3/5]

template<typename T >
template<typename Src >
requires (std::is_arithmetic_v<Src>)
v8::base::internal::CheckedNumeric< T >::CheckedNumeric ( Src value)
inlineconstexpr

Definition at line 41 of file checked_math.h.

◆ CheckedNumeric() [4/5]

template<typename T >
template<typename Src >
v8::base::internal::CheckedNumeric< T >::CheckedNumeric ( StrictNumeric< Src > value)
inlineconstexpr

Definition at line 47 of file checked_math.h.

◆ CheckedNumeric() [5/5]

template<typename T >
template<typename Src >
v8::base::internal::CheckedNumeric< T >::CheckedNumeric ( Src value,
bool is_valid )
inlineconstexprprivate

Definition at line 247 of file checked_math.h.

Member Function Documentation

◆ Abs()

template<typename T >
CheckedNumeric v8::base::internal::CheckedNumeric< T >::Abs ( ) const
inlineconstexpr

Definition at line 162 of file checked_math.h.

Here is the call graph for this function:

◆ AssignIfValid()

template<typename T >
template<typename Dst >
bool v8::base::internal::CheckedNumeric< T >::AssignIfValid ( Dst * result) const
inlineconstexpr

Definition at line 69 of file checked_math.h.

Here is the call graph for this function:

◆ Cast()

template<typename T >
template<typename Dst >
CheckedNumeric< UnderlyingType< Dst > > v8::base::internal::CheckedNumeric< T >::Cast ( ) const
inlineconstexpr

Definition at line 111 of file checked_math.h.

◆ FastRuntimeNegate()

template<typename T >
CheckedNumeric v8::base::internal::CheckedNumeric< T >::FastRuntimeNegate ( ) const
inlineprivate

Definition at line 240 of file checked_math.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ IsValid()

template<typename T >
template<typename Dst = T>
bool v8::base::internal::CheckedNumeric< T >::IsValid ( ) const
inlineconstexpr

Definition at line 54 of file checked_math.h.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ MathOp() [1/2]

template<typename T >
template<template< typename, typename > class M, typename L , typename R >
static constexpr CheckedNumeric v8::base::internal::CheckedNumeric< T >::MathOp ( L lhs,
R rhs )
inlinestaticconstexpr

Definition at line 212 of file checked_math.h.

Here is the call graph for this function:

◆ MathOp() [2/2]

template<typename T >
template<template< typename, typename > class M, typename R >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::MathOp ( R rhs)
inlineconstexpr

Definition at line 223 of file checked_math.h.

Here is the call graph for this function:

◆ Max()

template<typename T >
template<typename U >
CheckedNumeric< typename MathWrapper< CheckedMaxOp, T, U >::type > v8::base::internal::CheckedNumeric< T >::Max ( U rhs) const
inlineconstexpr

Definition at line 167 of file checked_math.h.

◆ Min()

template<typename T >
template<typename U >
CheckedNumeric< typename MathWrapper< CheckedMinOp, T, U >::type > v8::base::internal::CheckedNumeric< T >::Min ( U rhs) const
inlineconstexpr

Definition at line 173 of file checked_math.h.

◆ operator%=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator%= ( const Src rhs)
constexpr

◆ operator&=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator&= ( const Src rhs)
constexpr

◆ operator*=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator*= ( const Src rhs)
constexpr

◆ operator++() [1/2]

template<typename T >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator++ ( )
inlineconstexpr

Definition at line 187 of file checked_math.h.

◆ operator++() [2/2]

template<typename T >
CheckedNumeric v8::base::internal::CheckedNumeric< T >::operator++ ( int )
inlineconstexpr

Definition at line 192 of file checked_math.h.

◆ operator+=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator+= ( const Src rhs)
constexpr

◆ operator-()

template<typename T >
CheckedNumeric v8::base::internal::CheckedNumeric< T >::operator- ( ) const
inlineconstexpr

Definition at line 143 of file checked_math.h.

Here is the call graph for this function:

◆ operator--() [1/2]

template<typename T >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator-- ( )
inlineconstexpr

Definition at line 198 of file checked_math.h.

◆ operator--() [2/2]

template<typename T >
CheckedNumeric v8::base::internal::CheckedNumeric< T >::operator-- ( int )
inlineconstexpr

Definition at line 203 of file checked_math.h.

◆ operator-=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator-= ( const Src rhs)
constexpr

◆ operator/=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator/= ( const Src rhs)
constexpr

◆ operator<<=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator<<= ( const Src rhs)
constexpr

◆ operator>>=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator>>= ( const Src rhs)
constexpr

◆ operator^=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator^= ( const Src rhs)
constexpr

◆ operator|=()

template<typename T >
template<typename Src >
CheckedNumeric & v8::base::internal::CheckedNumeric< T >::operator|= ( const Src rhs)
constexpr

◆ operator~()

template<typename T >
CheckedNumeric v8::base::internal::CheckedNumeric< T >::operator~ ( ) const
inlineconstexpr

Definition at line 157 of file checked_math.h.

Here is the call graph for this function:

◆ UnsignedAbs()

template<typename T >
CheckedNumeric< typename UnsignedOrFloatForSize< T >::type > v8::base::internal::CheckedNumeric< T >::UnsignedAbs ( ) const
inlineconstexpr

Definition at line 182 of file checked_math.h.

Here is the call graph for this function:

◆ ValueOrDefault()

template<typename T >
template<typename Dst = T, typename Src >
StrictNumeric< Dst > v8::base::internal::CheckedNumeric< T >::ValueOrDefault ( Src default_value) const
inlineconstexpr

Definition at line 100 of file checked_math.h.

Here is the call graph for this function:

◆ ValueOrDie()

template<typename T >
template<typename Dst = T, class CheckHandler = CheckOnFailure>
StrictNumeric< Dst > v8::base::internal::CheckedNumeric< T >::ValueOrDie ( ) const
inlineconstexpr

Definition at line 86 of file checked_math.h.

Here is the call graph for this function:

Friends And Related Symbol Documentation

◆ CheckedNumeric

template<typename T >
template<typename U >
friend class CheckedNumeric
friend

Definition at line 236 of file checked_math.h.

◆ GetNumericValueForTest

template<typename T >
template<typename U >
U GetNumericValueForTest ( const CheckedNumeric< U > & src)
friend

Member Data Documentation

◆ state_

template<typename T >
CheckedNumericState<T> v8::base::internal::CheckedNumeric< T >::state_
private

Definition at line 238 of file checked_math.h.


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