Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Public Types | Static Public Member Functions | List of all members
base::internal::ClampedMulOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type > Struct Template Reference

#include <clamped_math_impl.h>

Public Types

using result_type = typename MaxExponentPromotion< T, U >::type
 

Static Public Member Functions

template<typename V = result_type>
static constexpr V Do (T x, U y)
 

Detailed Description

template<typename T, typename U>
struct base::internal::ClampedMulOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >

Definition at line 127 of file clamped_math_impl.h.

Member Typedef Documentation

◆ result_type

template<typename T , typename U >
using base::internal::ClampedMulOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::result_type = typename MaxExponentPromotion<T, U>::type

Definition at line 131 of file clamped_math_impl.h.

Member Function Documentation

◆ Do()

template<typename T , typename U >
template<typename V = result_type>
static constexpr V base::internal::ClampedMulOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >::Do ( T  x,
y 
)
inlinestaticconstexpr

Definition at line 133 of file clamped_math_impl.h.

133 {
134 // TODO(jschuh) Make this "constexpr if" once we're C++17.
136 return ClampedMulFastOp<T, U>::template Do<V>(x, y);
137
138 V result = {};
139 const V saturated =
140 CommonMaxOrMin<V>(IsValueNegative(x) ^ IsValueNegative(y));
141 return BASE_NUMERICS_LIKELY((CheckedMulOp<T, U>::Do(x, y, &result)))
142 ? result
143 : saturated;
144 }
GAsyncResult * result
T __attribute__((ext_vector_type(N))) V
double y
double x
constexpr bool IsValueNegative(T value)
#define BASE_NUMERICS_LIKELY(x)

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