Flutter Engine
The Flutter Engine
Public Member Functions | Static Public Member Functions | Static Public Attributes | List of all members
base::internal::ClampedNegFastOp< T > Struct Template Reference

#include <safe_math_clang_gcc_impl.h>

Public Member Functions

 __attribute__ ((always_inline)) static T Do(T value)
 

Static Public Member Functions

static constexpr T Do (T)
 

Static Public Attributes

static const bool is_supported = std::is_signed<T>::value
 

Detailed Description

template<typename T>
struct base::internal::ClampedNegFastOp< T >

Definition at line 138 of file safe_math_clang_gcc_impl.h.

Member Function Documentation

◆ __attribute__()

template<typename T >
base::internal::ClampedNegFastOp< T >::__attribute__ ( (always_inline)  )
inline

Definition at line 140 of file safe_math_clang_gcc_impl.h.

140 {
141 // Use this when there is no assembler path available.
143 T result;
144 return !__builtin_sub_overflow(T(0), value, &result)
145 ? result
147 }
148
149 // Fallback to the normal subtraction path.
150 return ClampedSubFastOp<T, T>::template Do<T>(T(0), value);
151 }
uint8_t value
GAsyncResult * result
static float max(float r, float g, float b)
Definition: hsl.cpp:49
#define T
Definition: precompiler.cc:65

◆ Do()

template<typename T >
static constexpr T base::internal::ClampedNegFastOp< T >::Do ( T  )
inlinestaticconstexpr

Definition at line 104 of file safe_math_shared_impl.h.

104 {
105 // Force a compile failure if instantiated.
106 return CheckOnFailure::template HandleFailure<T>();
107 }

Member Data Documentation

◆ is_supported

template<typename T >
static const bool base::internal::ClampedNegFastOp< T >::is_supported = std::is_signed<T>::value
static

Definition at line 139 of file safe_math_clang_gcc_impl.h.


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