Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Static Public Member Functions | Static Public Attributes | List of all members
base::internal::IsValueInRangeFastOp< Dst, Src, typename std::enable_if< std::is_integral< Dst >::value &&std::is_integral< Src >::value &&!std::is_signed< Dst >::value &&std::is_signed< Src >::value &&!IsTypeInRangeForNumericType< Dst, Src >::value >::type > Struct Template Reference

#include <safe_conversions.h>

Static Public Member Functions

static constexpr bool Do (Src value)
 

Static Public Attributes

static constexpr bool is_supported = true
 

Detailed Description

template<typename Dst, typename Src>
struct base::internal::IsValueInRangeFastOp< Dst, Src, typename std::enable_if< std::is_integral< Dst >::value &&std::is_integral< Src >::value &&!std::is_signed< Dst >::value &&std::is_signed< Src >::value &&!IsTypeInRangeForNumericType< Dst, Src >::value >::type >

Definition at line 72 of file safe_conversions.h.

Member Function Documentation

◆ Do()

template<typename Dst , typename Src >
static constexpr bool base::internal::IsValueInRangeFastOp< Dst, Src, typename std::enable_if< std::is_integral< Dst >::value &&std::is_integral< Src >::value &&!std::is_signed< Dst >::value &&std::is_signed< Src >::value &&!IsTypeInRangeForNumericType< Dst, Src >::value >::type >::Do ( Src  value)
inlinestaticconstexpr

Definition at line 81 of file safe_conversions.h.

81 {
82 // We cast a signed as unsigned to overflow negative values to the top,
83 // then compare against whichever maximum is smaller, as our upper bound.
84 return as_unsigned(value) <= as_unsigned(CommonMax<Src, Dst>());
85 }
constexpr std::make_unsigned< typenamebase::internal::UnderlyingType< Src >::type >::type as_unsigned(const Src value)

Member Data Documentation

◆ is_supported

template<typename Dst , typename Src >
constexpr bool base::internal::IsValueInRangeFastOp< Dst, Src, typename std::enable_if< std::is_integral< Dst >::value &&std::is_integral< Src >::value &&!std::is_signed< Dst >::value &&std::is_signed< Src >::value &&!IsTypeInRangeForNumericType< Dst, Src >::value >::type >::is_supported = true
staticconstexpr

Definition at line 79 of file safe_conversions.h.


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