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 23 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 27 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

template <typename Src>
void ClampedNumeric<T> (Src value)

NOLINTNEXTLINE(google-explicit-constructor)

Defined at line 35 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

template <typename Src>
void ClampedNumeric<T> (StrictNumeric<Src> value)

NOLINTNEXTLINE(google-explicit-constructor)

Defined at line 41 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

template <typename Dst>
ClampedNumeric<UnderlyingType<Dst>> Cast ()

Returns a ClampedNumeric of the specified type, cast from the current

ClampedNumeric, and saturated to the destination type.

Defined at line 47 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

ClampedNumeric<T> operator- ()

Defined at line 73 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

ClampedNumeric<T> operator~ ()

Defined at line 79 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

ClampedNumeric<T> Abs ()

Defined at line 83 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

template <typename U>
ClampedNumeric<typename MathWrapper<ClampedMaxOp, T, U>::type> Max (U rhs)

Defined at line 90 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

template <typename U>
ClampedNumeric<typename MathWrapper<ClampedMinOp, T, U>::type> Min (U rhs)

Defined at line 98 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 108 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

ClampedNumeric<T> & operator++ ()

Defined at line 114 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

ClampedNumeric<T> operator++ (int )

Defined at line 119 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

ClampedNumeric<T> & operator-- ()

Defined at line 125 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

ClampedNumeric<T> operator-- (int )

Defined at line 130 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

template <template <typename, typename> class M, typename L, typename R>
ClampedNumeric<T> MathOp (L lhs, R rhs)

These perform the actual math operations on the ClampedNumerics.

Binary arithmetic operations.

Defined at line 139 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

template <template <typename, typename> class M, typename R>
ClampedNumeric<T> & MathOp (R rhs)

Assignment arithmetic operations.

Defined at line 147 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

template <typename Dst>
Dst operator Dst ()

Defined at line 156 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 163 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

template <typename Src>
ClampedNumeric<T> & operator+= (const Src rhs)

Prototypes for the supported arithmetic operator overloads.

Defined at line 202 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 203 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 204 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 205 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 206 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 207 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 208 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 209 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 210 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 211 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math.h

Records

Friends

template <typename U>
class ClampedNumeric