Flutter Engine
The Flutter Engine
Loading...
Searching...
No Matches
Classes | Namespaces | Macros | Functions
clamped_math_impl.h File Reference
#include <climits>
#include <cmath>
#include <cstddef>
#include <cstdint>
#include <cstdlib>
#include <limits>
#include <type_traits>
#include "base/numerics/checked_math.h"
#include "base/numerics/safe_conversions.h"
#include "base/numerics/safe_math_shared_impl.h"

Go to the source code of this file.

Classes

struct  base::internal::ClampedAddOp< T, U, Enable >
 
struct  base::internal::ClampedAddOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedSubOp< T, U, Enable >
 
struct  base::internal::ClampedSubOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedMulOp< T, U, Enable >
 
struct  base::internal::ClampedMulOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedDivOp< T, U, Enable >
 
struct  base::internal::ClampedDivOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedModOp< T, U, Enable >
 
struct  base::internal::ClampedModOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedLshOp< T, U, Enable >
 
struct  base::internal::ClampedLshOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedRshOp< T, U, Enable >
 
struct  base::internal::ClampedRshOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedAndOp< T, U, Enable >
 
struct  base::internal::ClampedAndOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedOrOp< T, U, Enable >
 
struct  base::internal::ClampedOrOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedXorOp< T, U, Enable >
 
struct  base::internal::ClampedXorOp< T, U, typename std::enable_if< std::is_integral< T >::value &&std::is_integral< U >::value >::type >
 
struct  base::internal::ClampedMaxOp< T, U, Enable >
 
struct  base::internal::ClampedMaxOp< T, U, typename std::enable_if< std::is_arithmetic< T >::value &&std::is_arithmetic< U >::value >::type >
 
struct  base::internal::ClampedMinOp< T, U, Enable >
 
struct  base::internal::ClampedMinOp< T, U, typename std::enable_if< std::is_arithmetic< T >::value &&std::is_arithmetic< U >::value >::type >
 

Namespaces

namespace  base
 
namespace  base::internal
 

Macros

#define BASE_FLOAT_ARITHMETIC_OPS(NAME, OP)
 

Functions

template<typename T , typename std::enable_if< std::is_integral< T >::value &&std::is_signed< T >::value >::type * = nullptr>
constexpr T base::internal::SaturatedNegWrapper (T value)
 
template<typename T , typename std::enable_if< std::is_integral< T >::value >::type * = nullptr>
constexpr T base::internal::SaturatedAbsWrapper (T value)
 

Macro Definition Documentation

◆ BASE_FLOAT_ARITHMETIC_OPS

#define BASE_FLOAT_ARITHMETIC_OPS (   NAME,
  OP 
)
Value:
template <typename T, typename U> \
struct Clamped##NAME##Op< \
T, U, \
typename std::enable_if<std::is_floating_point<T>::value || \
std::is_floating_point<U>::value>::type> { \
using result_type = typename MaxExponentPromotion<T, U>::type; \
template <typename V = result_type> \
static constexpr V Do(T x, U y) { \
return saturated_cast<V>(x OP y); \
} \
};
T __attribute__((ext_vector_type(N))) V
double y
double x
Definition ref_ptr.h:256
#define T

Definition at line 317 of file clamped_math_impl.h.

322 { \
323 using result_type = typename MaxExponentPromotion<T, U>::type; \
324 template <typename V = result_type> \
325 static constexpr V Do(T x, U y) { \
326 return saturated_cast<V>(x OP y); \
327 } \
328 };