template <typename T>
class ClampedNumeric
Defined at line 19 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
Public Methods
void ClampedNumeric<T> ()
Defined at line 26 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
void ClampedNumeric<T> (const ClampedNumeric<Src> & rhs)
Copy constructor.
Defined at line 30 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
void ClampedNumeric<T> (Src value)
This is not an explicit constructor because we implicitly upgrade regular
numerics to ClampedNumerics to make them easier to use.
Defined at line 39 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
void ClampedNumeric<T> (StrictNumeric<Src> value)
This is not an explicit constructor because we want a seamless conversion
from StrictNumeric types.
Defined at line 47 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Dst>
ClampedNumeric<typename UnderlyingType<Dst>::type> Cast ()
Returns a ClampedNumeric of the specified type, cast from the current
ClampedNumeric, and saturated to the destination type.
Defined at line 54 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
ClampedNumeric<T> operator- ()
Defined at line 80 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
ClampedNumeric<T> operator~ ()
Defined at line 86 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
ClampedNumeric<T> Abs ()
Defined at line 90 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename U>
ClampedNumeric<typename MathWrapper<ClampedMaxOp, T, U>::type> Max (const U rhs)
Defined at line 97 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename U>
ClampedNumeric<typename MathWrapper<ClampedMinOp, T, U>::type> Min (const U rhs)
Defined at line 105 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
ClampedNumeric<typename UnsignedOrFloatForSize<T>::type> UnsignedAbs ()
This function is available only for integral types. It returns an unsigned
integer of the same width as the source type, containing the absolute value
of the source, and properly handling signed min.
Defined at line 115 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
ClampedNumeric<T> & operator++ ()
Defined at line 121 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
ClampedNumeric<T> operator++ (int )
Defined at line 126 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
ClampedNumeric<T> & operator-- ()
Defined at line 132 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
ClampedNumeric<T> operator-- (int )
Defined at line 137 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <template <typename, typename, typename> class M, typename L, typename R>
ClampedNumeric<T> MathOp (const L lhs, const R rhs)
These perform the actual math operations on the ClampedNumerics.
Binary arithmetic operations.
Defined at line 148 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <template <typename, typename, typename> class M, typename R>
ClampedNumeric<T> & MathOp (const R rhs)
Assignment arithmetic operations.
Defined at line 156 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Dst>
Dst operator Dst ()
Defined at line 164 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
T RawValue ()
This method extracts the raw integer value without saturating it to the
destination type as the conversion operator does. This is useful when
e.g. assigning to an auto type or passing as a deduced template parameter.
Defined at line 172 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator+= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 226 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator-= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 227 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator*= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 228 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator/= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 229 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator%= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 230 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator<<= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 231 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator>>= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 232 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator&= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 233 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator|= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 234 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
template <typename Src>
ClampedNumeric<T> & operator^= (const Src rhs)
Assignment arithmetic operator implementation from CLASS##Numeric.
Defined at line 235 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h
Records
Friends
template <typename Src>
class ClampedNumeric