Enumerations

enum IntegerRepresentation
Name Value
INTEGER_REPRESENTATION_UNSIGNED 0
INTEGER_REPRESENTATION_SIGNED 1

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

enum NumericRangeRepresentation
Name Value
NUMERIC_RANGE_NOT_CONTAINED 0
NUMERIC_RANGE_CONTAINED 1

A range for a given nunmeric Src type is contained for a given numeric Dst

type if both numeric_limits

<Src

>::max()

<

= numeric_limits

<Dst

>::max() and

numeric_limits

<Src

>::lowest() >= numeric_limits

<Dst

>::lowest() are true.

We implement this as template specializations rather than simple static

comparisons to ensure type correctness in our comparisons.

Defined at line 140 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

enum ArithmeticPromotionCategory
Name Value
LEFT_PROMOTION 0
RIGHT_PROMOTION 1

Defined at line 444 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

enum NumericRepresentation
Name Value
NUMERIC_INTEGER 0
NUMERIC_FLOATING 1
NUMERIC_UNKNOWN 2

Floats carry around their validity state with them, but integers do not. So,

we wrap the underlying value in a specialization in order to hide that detail

and expose an interface via accessors.

Defined at line 445 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math_impl.h

Records

Functions

  • template <typename T>
    bool CheckedAddImpl (T x, T y, T * result)

    Defined at line 24 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math_impl.h

  • template <typename U>
    U GetNumericValueForTest (const CheckedNumeric<U> & src)

    This friend method is available solely for providing more detailed logging

    in the the tests. Do not implement it in production code, because the

    underlying values may change at any time.

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

    Defined at line 27 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math_impl.h

  • template <typename T, typename std::enable_if<std::is_integral<T>::value &&
                                                                  !std::is_signed<T>::value>::type* = nullptr>
    T SaturatedNegWrapper (T value)

    Defined at line 38 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math_impl.h

  • template <typename T, typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr>
    T SaturatedNegWrapper (T value)

    Defined at line 45 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math_impl.h

  • template <typename T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
    T SaturatedAbsWrapper (T value)

    Defined at line 51 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math_impl.h

  • template <typename T, typename std::enable_if<std::is_signed<T>::value>::type* = nullptr>
    bool IsValueNegative (T value)

    Determines if a numeric value is negative without throwing compiler

    warnings on: unsigned(value)

    <

    0.

    Defined at line 52 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename T, typename std::enable_if<!std::is_signed<T>::value>::type* = nullptr>
    bool IsValueNegative (T )

    Defined at line 59 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename T, typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr>
    T SaturatedAbsWrapper (T value)

    Defined at line 67 of file ../../zircon/third_party/ulib/safemath/include/safemath/clamped_math_impl.h

  • template <typename T>
    typename std::make_signed<T>::type ConditionalNegate (T x, bool is_negative)

    This performs a fast negation, returning a signed value. It works on unsigned

    arguments, but probably doesn't do what you want for any unsigned value

    larger than max / 2 + 1 (i.e. signed min cast to unsigned).

    Defined at line 68 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename T>
    typename std::make_unsigned<T>::type SafeUnsignedAbs (T value)

    This performs a safe, absolute value via unsigned overflow.

    Defined at line 80 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename T>
    bool CheckedSubImpl (T x, T y, T * result)

    Defined at line 84 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math_impl.h

  • bool CanDetectCompileTimeConstant ()

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

  • template <typename Dst, typename Src>
    bool IsValueInRangeForNumericType (Src value)

    Convenience function that returns true if the supplied value is in range

    for the destination type.

    Defined at line 91 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <typename T>
    bool IsCompileTimeConstant (const T v)

    Defined at line 94 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename T>
    bool MustTreatAsConstexpr (const T v)

    Defined at line 107 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename Dst, class CheckHandler = internal::CheckOnFailure, typename Src>
    Dst checked_cast (Src value)

    checked_cast

    <

    > is analogous to static_cast

    <

    > for numeric types,

    except that it CHECKs that the specified numeric conversion will not

    overflow or underflow. NaN source will always trigger a CHECK.

    Defined at line 107 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <typename T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
    T NegateWrapper (T value)

    Wrap the unary operations to allow SFINAE when instantiating integrals versus

    floating points. These don't perform any overflow checking. Rather, they

    exhibit well-defined overflow semantics and rely on the caller to detect

    if an overflow occurred.

    Defined at line 138 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_math_shared_impl.h

  • template <typename Dst, template <typename> class S, typename Src>
    Dst saturated_cast_impl (Src value, RangeCheck constraint)

    Defined at line 141 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <typename T>
    bool CheckedMulImpl (T x, T y, T * result)

    Defined at line 144 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math_impl.h

  • template <typename T, typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr>
    T NegateWrapper (T value)

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

  • template <typename T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
    typename std::make_unsigned<T>::type InvertWrapper (T value)

    Defined at line 153 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_math_shared_impl.h

  • template <typename T, typename std::enable_if<std::is_integral<T>::value>::type* = nullptr>
    T AbsWrapper (T value)

    Defined at line 159 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_math_shared_impl.h

  • template <typename T, typename std::enable_if<std::is_floating_point<T>::value>::type* = nullptr>
    T AbsWrapper (T value)

    Defined at line 166 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_math_shared_impl.h

  • template <typename T>
    ClampedNumeric<typename UnderlyingType<T>::type> MakeClampedNum (const T value)

    Convience wrapper to return a new ClampedNumeric from the provided arithmetic

    or ClampedNumericType.

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

  • template <typename T>
    std::ostream & operator<< (std::ostream & os, const ClampedNumeric<T> & value)

    Overload the ostream output operator to make logging work nicely.

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

  • template <typename Dst, template <typename> class SaturationHandler = SaturationDefaultLimits, typename Src>
    Dst saturated_cast (Src value)

    saturated_cast

    <

    > is analogous to static_cast

    <

    > for numeric types, except

    that the specified numeric conversion will saturate by default rather than

    overflow or underflow, and NaN assignment to an integral will return 0.

    All boundary condition behaviors can be overriden with a custom handler.

    Defined at line 204 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <template <typename, typename, typename> class M, typename L, typename R>
    ClampedNumeric<typename MathWrapper<M, L, R>::type> ClampMathOp (const L lhs, const R rhs)

    These implement the variadic wrapper for the math operations.

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

  • template <template <typename, typename, typename> class M, typename L, typename R, typename... Args>
    ClampedNumeric<typename ResultType<M, L, R, Args...>::type> ClampMathOp (const L lhs, const R rhs, const Args... args)

    General purpose wrapper template for arithmetic operations.

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

  • template <typename Dst, typename Src>
    Dst strict_cast (Src value)

    strict_cast

    <

    > is analogous to static_cast

    <

    > for numeric types, except that

    it will cause a compile failure if the destination type is not large enough

    to contain any value in the source type. It performs no runtime checking.

    Defined at line 221 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedAddOp, L, R, Args...>::type> ClampAdd (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedAddOp, L, R>::type> operator+ (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedSubOp, L, R, Args...>::type> ClampSub (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedSubOp, L, R>::type> operator- (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedMulOp, L, R, Args...>::type> ClampMul (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedMulOp, L, R>::type> operator* (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedDivOp, L, R, Args...>::type> ClampDiv (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedDivOp, L, R>::type> operator/ (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedModOp, L, R, Args...>::type> ClampMod (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedModOp, L, R>::type> operator% (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedLshOp, L, R, Args...>::type> ClampLsh (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedLshOp, L, R>::type> operator<< (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedRshOp, L, R, Args...>::type> ClampRsh (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedRshOp, L, R>::type> operator>> (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedAndOp, L, R, Args...>::type> ClampAnd (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedAndOp, L, R>::type> operator& (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedOrOp, L, R, Args...>::type> ClampOr (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedOrOp, L, R>::type> operator| (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedXorOp, L, R, Args...>::type> ClampXor (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename MathWrapper<ClampedXorOp, L, R>::type> operator^ (const L lhs, const R rhs)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedMaxOp, L, R, Args...>::type> ClampMax (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    ClampedNumeric<typename ResultType<ClampedMinOp, L, R, Args...>::type> ClampMin (const L lhs, const R rhs, const Args... args)

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

  • template <, , >
    bool operator< (const L lhs, const R rhs)

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

  • template <, , >
    bool operator<= (const L lhs, const R rhs)

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

  • template <, , >
    bool operator> (const L lhs, const R rhs)

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

  • template <, , >
    bool operator>= (const L lhs, const R rhs)

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

  • template <, , >
    bool operator== (const L lhs, const R rhs)

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

  • template <, , >
    bool operator!= (const L lhs, const R rhs)

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

  • template <typename Dst, typename Src>
    bool IsValidForType (const CheckedNumeric<Src> value)

    Convenience functions to avoid the ugly template disambiguator syntax.

    Defined at line 291 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <typename Dst, typename Src>
    StrictNumeric<Dst> ValueOrDieForType (const CheckedNumeric<Src> value)

    Defined at line 296 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <typename Dst, typename Src, typename Default>
    StrictNumeric<Dst> ValueOrDefaultForType (const CheckedNumeric<Src> value, const Default default_value)

    Defined at line 302 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <typename T>
    StrictNumeric<typename UnderlyingType<T>::type> MakeStrictNum (const T value)

    Convience wrapper returns a StrictNumeric from the provided arithmetic type.

    Defined at line 309 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <typename T>
    CheckedNumeric<typename UnderlyingType<T>::type> MakeCheckedNum (const T value)

    Convience wrapper to return a new CheckedNumeric from the provided arithmetic

    or CheckedNumericType.

    Defined at line 311 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <typename T>
    std::ostream & operator<< (std::ostream & os, const StrictNumeric<T> & value)

    Overload the ostream output operator to make logging work nicely.

    Defined at line 317 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <template <typename, typename, typename> class M, typename L, typename R>
    CheckedNumeric<typename MathWrapper<M, L, R>::type> CheckMathOp (const L lhs, const R rhs)

    These implement the variadic wrapper for the math operations.

    Defined at line 320 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    bool operator< (const L lhs, const R rhs)

    Defined at line 332 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <, , >
    bool operator<= (const L lhs, const R rhs)

    Defined at line 333 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <template <typename, typename, typename> class M, typename L, typename R, typename... Args>
    CheckedNumeric<typename ResultType<M, L, R, Args...>::type> CheckMathOp (const L lhs, const R rhs, const Args... args)

    General purpose wrapper template for arithmetic operations.

    Defined at line 333 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    bool operator> (const L lhs, const R rhs)

    Defined at line 334 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <, , >
    bool operator>= (const L lhs, const R rhs)

    Defined at line 335 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <, , >
    bool operator== (const L lhs, const R rhs)

    Defined at line 336 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <, , >
    bool operator!= (const L lhs, const R rhs)

    Defined at line 337 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedAddOp, L, R, Args...>::type> CheckAdd (const L lhs, const R rhs, const Args... args)

    Defined at line 338 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedAddOp, L, R>::type> operator+ (const L lhs, const R rhs)

    Defined at line 338 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedSubOp, L, R, Args...>::type> CheckSub (const L lhs, const R rhs, const Args... args)

    Defined at line 339 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedSubOp, L, R>::type> operator- (const L lhs, const R rhs)

    Defined at line 339 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedMulOp, L, R, Args...>::type> CheckMul (const L lhs, const R rhs, const Args... args)

    Defined at line 340 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedMulOp, L, R>::type> operator* (const L lhs, const R rhs)

    Defined at line 340 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedDivOp, L, R, Args...>::type> CheckDiv (const L lhs, const R rhs, const Args... args)

    Defined at line 341 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedDivOp, L, R>::type> operator/ (const L lhs, const R rhs)

    Defined at line 341 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedModOp, L, R, Args...>::type> CheckMod (const L lhs, const R rhs, const Args... args)

    Defined at line 342 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedModOp, L, R>::type> operator% (const L lhs, const R rhs)

    Defined at line 342 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedLshOp, L, R, Args...>::type> CheckLsh (const L lhs, const R rhs, const Args... args)

    Defined at line 343 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedLshOp, L, R>::type> operator<< (const L lhs, const R rhs)

    Defined at line 343 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedRshOp, L, R, Args...>::type> CheckRsh (const L lhs, const R rhs, const Args... args)

    Defined at line 344 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedRshOp, L, R>::type> operator>> (const L lhs, const R rhs)

    Defined at line 344 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedAndOp, L, R, Args...>::type> CheckAnd (const L lhs, const R rhs, const Args... args)

    Defined at line 345 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedAndOp, L, R>::type> operator& (const L lhs, const R rhs)

    Defined at line 345 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedOrOp, L, R, Args...>::type> CheckOr (const L lhs, const R rhs, const Args... args)

    Defined at line 346 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedOrOp, L, R>::type> operator| (const L lhs, const R rhs)

    Defined at line 346 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedXorOp, L, R, Args...>::type> CheckXor (const L lhs, const R rhs, const Args... args)

    Defined at line 347 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename MathWrapper<CheckedXorOp, L, R>::type> operator^ (const L lhs, const R rhs)

    Defined at line 347 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedMaxOp, L, R, Args...>::type> CheckMax (const L lhs, const R rhs, const Args... args)

    Defined at line 348 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <, , >
    CheckedNumeric<typename ResultType<CheckedMinOp, L, R, Args...>::type> CheckMin (const L lhs, const R rhs, const Args... args)

    Defined at line 349 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <typename L, typename R>
    L * operator+ (L * lhs, const StrictNumeric<R> rhs)

    These are some extra StrictNumeric operators to support simple pointer

    arithmetic with our result types. Since wrapping on a pointer is always

    bad, we trigger the CHECK condition here.

    Defined at line 355 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <typename L, typename R>
    L * operator- (L * lhs, const StrictNumeric<R> rhs)

    Defined at line 363 of file ../../zircon/third_party/ulib/safemath/include/safemath/checked_math.h

  • template <typename Dst, template <typename> class Bounds = std::numeric_limits, typename Src>
    RangeCheck DstRangeRelationToSrcRange (Src value)

    Defined at line 403 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename Src>
    typename std::make_signed<typename safemath::internal::UnderlyingType<Src>::type>::type as_signed (const Src value)

    as_signed

    <

    > returns the supplied integral value (or integral castable

    Numeric template) cast as a signed integral of equivalent precision.

    I.e. it's mostly an alias for: static_cast

    <std

    ::make_signed

    <T

    >::type>(t)

    Defined at line 671 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename Src>
    typename std::make_unsigned<typename safemath::internal::UnderlyingType<Src>::type>::type as_unsigned (const Src value)

    as_unsigned

    <

    > returns the supplied integral value (or integral castable

    Numeric template) cast as an unsigned integral of equivalent precision.

    I.e. it's mostly an alias for: static_cast

    <std

    ::make_unsigned

    <T

    >::type>(t)

    Defined at line 683 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename L, typename R>
    bool IsLessImpl (const L lhs, const R rhs, const RangeCheck l_range, const RangeCheck r_range)

    Defined at line 692 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename L, typename R>
    bool IsLessOrEqualImpl (const L lhs, const R rhs, const RangeCheck l_range, const RangeCheck r_range)

    Defined at line 712 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename L, typename R>
    bool IsGreaterImpl (const L lhs, const R rhs, const RangeCheck l_range, const RangeCheck r_range)

    Defined at line 732 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename L, typename R>
    bool IsGreaterOrEqualImpl (const L lhs, const R rhs, const RangeCheck l_range, const RangeCheck r_range)

    Defined at line 752 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <template <typename, typename> class C, typename L, typename R>
    bool SafeCompare (const L lhs, const R rhs)

    These perform the actual math operations on the CheckedNumerics.

    Binary arithmetic operations.

    Defined at line 798 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename Dst, typename Src>
    bool IsMaxInRangeForNumericType ()

    Defined at line 813 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename Dst, typename Src>
    bool IsMinInRangeForNumericType ()

    Defined at line 819 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename Dst, typename Src>
    Dst CommonMax ()

    Defined at line 825 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename Dst, typename Src>
    Dst CommonMin ()

    Defined at line 832 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h

  • template <typename Dsttypename Src = Dst>
    Dst CommonMaxOrMin (bool is_min)

    This is a wrapper to generate return the max or min for a supplied type.

    If the argument is false, the returned value is the maximum. If true the

    returned value is the minimum.

    Defined at line 842 of file ../../zircon/third_party/ulib/safemath/include/safemath/safe_conversions_impl.h