|
template<class T >
requires (std::is_unsigned_v<T> && std::is_integral_v<T>) |
constexpr T | SwapBytes (T value) |
|
template<class T >
requires (std::is_signed_v<T> && std::is_integral_v<T>) |
constexpr T | SwapBytes (T value) |
|
template<class T >
requires (std::is_unsigned_v<T> && std::is_integral_v<T>) |
constexpr T | FromLittleEndian (std::span< const uint8_t, sizeof(T)> bytes) |
|
template<class T >
requires (std::is_signed_v<T> && std::is_integral_v<T>) |
constexpr T | FromLittleEndian (std::span< const uint8_t, sizeof(T)> bytes) |
|
template<class T >
requires (std::is_unsigned_v<T> && std::is_integral_v<T>) |
constexpr std::array< uint8_t, sizeof(T)> | ToLittleEndian (T val) |
|
template<class T >
requires (std::is_signed_v<T> && std::is_integral_v<T>) |
constexpr std::array< uint8_t, sizeof(T)> | ToLittleEndian (T val) |
|
template<typename T > |
| CheckedNumeric (T) -> CheckedNumeric< T > |
|
template<typename Dst , typename Src > |
constexpr bool | IsValidForType (const CheckedNumeric< Src > value) |
|
template<typename Dst , typename Src > |
constexpr StrictNumeric< Dst > | ValueOrDieForType (const CheckedNumeric< Src > value) |
|
template<typename Dst , typename Src , typename Default > |
constexpr StrictNumeric< Dst > | ValueOrDefaultForType (CheckedNumeric< Src > value, Default default_value) |
|
template<typename T > |
constexpr CheckedNumeric< UnderlyingType< T > > | MakeCheckedNum (T value) |
|
template<template< typename, typename > class M, typename L , typename R > |
constexpr CheckedNumeric< typename MathWrapper< M, L, R >::type > | CheckMathOp (L lhs, R rhs) |
|
template<template< typename, typename > class M, typename L , typename R , typename... Args> |
constexpr auto | CheckMathOp (L lhs, R rhs, Args... args) |
|
template<typename L , typename R > |
L * | operator+ (L *lhs, StrictNumeric< R > rhs) |
|
template<typename L , typename R > |
L * | operator- (L *lhs, StrictNumeric< R > rhs) |
|
template<typename T > |
constexpr bool | CheckedAddImpl (T x, T y, T *result) |
|
template<typename T > |
constexpr bool | CheckedSubImpl (T x, T y, T *result) |
|
template<typename T > |
constexpr bool | CheckedMulImpl (T x, T y, T *result) |
|
template<typename T > |
| ClampedNumeric (T) -> ClampedNumeric< T > |
|
template<typename T > |
constexpr ClampedNumeric< UnderlyingType< T > > | MakeClampedNum (T value) |
|
template<template< typename, typename > class M, typename L , typename R > |
constexpr ClampedNumeric< typename MathWrapper< M, L, R >::type > | ClampMathOp (L lhs, R rhs) |
|
template<template< typename, typename > class M, typename L , typename R , typename... Args> |
constexpr auto | ClampMathOp (L lhs, R rhs, Args... args) |
|
template<typename T >
requires (std::signed_integral<T>) |
constexpr T | SaturatedNegWrapper (T value) |
|
template<typename T >
requires (std::unsigned_integral<T>) |
constexpr T | SaturatedNegWrapper (T value) |
|
template<typename T >
requires (std::floating_point<T>) |
constexpr T | SaturatedNegWrapper (T value) |
|
template<typename T >
requires (std::integral<T>) |
constexpr T | SaturatedAbsWrapper (T value) |
|
template<typename T >
requires (std::floating_point<T>) |
constexpr T | SaturatedAbsWrapper (T value) |
|
template<typename T > |
std::ostream & | operator<< (std::ostream &os, const StrictNumeric< T > &value) |
|
template<typename T > |
std::ostream & | operator<< (std::ostream &os, const ClampedNumeric< T > &value) |
|
template<typename Dst , typename Src >
requires (IsNumeric<Src> && std::is_arithmetic_v<Dst> && std::numeric_limits<Dst>::lowest() < std::numeric_limits<Dst>::max()) |
constexpr bool | IsValueInRangeForNumericType (Src value) |
|
template<typename Dst , class CheckHandler = internal::CheckOnFailure, typename Src >
requires (IsNumeric<Src> && std::is_arithmetic_v<Dst> && std::numeric_limits<Dst>::lowest() < std::numeric_limits<Dst>::max()) |
constexpr Dst | checked_cast (Src value) |
|
template<typename Dst , template< typename > class S, typename Src > |
constexpr Dst | saturated_cast_impl (Src value, RangeCheck constraint) |
|
template<typename Dst , template< typename > class SaturationHandler = SaturationDefaultLimits, typename Src > |
constexpr Dst | saturated_cast (Src value) |
|
template<typename Dst , typename Src , typename SrcType = UnderlyingType<Src>>
requires ( IsNumeric<Src> && std::is_arithmetic_v<Dst> && // If you got here from a compiler error, it's because you tried to assign // from a source type to a destination type that has insufficient range. // The solution may be to change the destination type you're assigning to, // and use one large enough to represent the source. // Alternatively, you may be better served with the checked_cast<> or // saturated_cast<> template functions for your particular use case. kStaticDstRangeRelationToSrcRange<Dst, SrcType> == NumericRangeRepresentation::kContained) |
constexpr Dst | strict_cast (Src value) |
|
template<typename T > |
| StrictNumeric (T) -> StrictNumeric< T > |
|
template<typename T > |
constexpr StrictNumeric< UnderlyingType< T > > | MakeStrictNum (const T value) |
|
template<typename T >
requires (std::is_arithmetic_v<T>) |
constexpr bool | IsValueNegative (T value) |
|
template<typename T >
requires std::is_integral_v<T> |
constexpr auto | ConditionalNegate (T x, bool is_negative) |
|
template<typename T >
requires std::is_integral_v<T> |
constexpr auto | SafeUnsignedAbs (T value) |
|
template<typename Dst , template< typename > class Bounds = std::numeric_limits, typename Src >
requires (std::is_arithmetic_v<Src> && std::is_arithmetic_v<Dst> && Bounds<Dst>::lowest() < Bounds<Dst>::max()) |
constexpr RangeCheck | DstRangeRelationToSrcRange (Src value) |
|
| INTEGER_FOR_DIGITS_AND_SIGN (int8_t) |
|
| INTEGER_FOR_DIGITS_AND_SIGN (uint8_t) |
|
| INTEGER_FOR_DIGITS_AND_SIGN (int16_t) |
|
| INTEGER_FOR_DIGITS_AND_SIGN (uint16_t) |
|
| INTEGER_FOR_DIGITS_AND_SIGN (int32_t) |
|
| INTEGER_FOR_DIGITS_AND_SIGN (uint32_t) |
|
| INTEGER_FOR_DIGITS_AND_SIGN (int64_t) |
|
| INTEGER_FOR_DIGITS_AND_SIGN (uint64_t) |
|
template<typename Src , typename Dst = std::make_signed_t<UnderlyingType<Src>>>
requires std::integral<Dst> |
constexpr auto | as_signed (Src value) |
|
template<typename Src , typename Dst = std::make_unsigned_t<UnderlyingType<Src>>>
requires std::integral<Dst> |
constexpr auto | as_unsigned (Src value) |
|
template<template< typename, typename > typename C, typename L , typename R >
requires std::is_arithmetic_v<L> && std::is_arithmetic_v<R> |
constexpr bool | SafeCompare (L lhs, R rhs) |
|
template<typename Dst , typename Src = Dst> |
constexpr Dst | CommonMaxOrMin (bool is_min) |
|
template<typename T >
requires (std::integral<T>) |
constexpr T | NegateWrapper (T value) |
|
template<typename T >
requires (std::floating_point<T>) |
constexpr T | NegateWrapper (T value) |
|
template<typename T >
requires (std::integral<T>) |
constexpr std::make_unsigned< T >::type | InvertWrapper (T value) |
|
template<typename T >
requires (std::integral<T>) |
constexpr T | AbsWrapper (T value) |
|
template<typename T >
requires (std::floating_point<T>) |
constexpr T | AbsWrapper (T value) |
|
|
template<typename Dst , typename Src > |
constexpr bool | kIsNumericRangeContained = false |
|
template<typename Dst , typename Src > |
constexpr bool | kIsNumericRangeContained< Dst, Src > |
|
template<typename NumericType > |
constexpr int | kMaxExponent |
|
template<typename NumericType > |
constexpr int | kIntegerBitsPlusSign |
|
constexpr bool | kEnableAsmCode = false |
|
template<typename Dst , typename Src , IntegerRepresentation DstSign = std::is_signed_v<Dst> ? IntegerRepresentation::kSigned : IntegerRepresentation::kUnsigned, IntegerRepresentation SrcSign = std::is_signed_v<Src> ? IntegerRepresentation::kSigned : IntegerRepresentation::kUnsigned> |
constexpr auto | kStaticDstRangeRelationToSrcRange |
|
template<typename Dst , typename Src > |
constexpr bool | kIsTypeInRangeForNumericType |
|
template<typename Lhs , typename Rhs > |
constexpr bool | kIsBigEnoughPromotionContained |
|
template<typename T , typename Lhs , typename Rhs = Lhs> |
constexpr bool | kIsIntegerArithmeticSafe |
|
template<typename Lhs , typename Rhs > |
constexpr bool | kIsFastIntegerArithmeticPromotionContained |
|
template<typename T > |
constexpr bool | kIsCheckedNumeric = false |
|
template<typename T > |
constexpr bool | kIsCheckedNumeric< CheckedNumeric< T > > = true |
|
template<typename T > |
constexpr bool | kIsClampedNumeric = false |
|
template<typename T > |
constexpr bool | kIsClampedNumeric< ClampedNumeric< T > > = true |
|
template<typename T > |
constexpr bool | kIsStrictNumeric = false |
|
template<typename T > |
constexpr bool | kIsStrictNumeric< StrictNumeric< T > > = true |
|
template<typename T > |
constexpr bool | kIsNumeric = std::is_arithmetic_v<UnderlyingType<T>> |
|
template<typename T > |
constexpr bool | kIsNumeric< T > = true |
|
template<typename Dst , typename Src > |
constexpr bool | kIsMaxInRangeForNumericType |
|
template<typename Dst , typename Src > |
constexpr bool | kIsMinInRangeForNumericType |
|
template<typename Dst , typename Src > |
constexpr Dst | kCommonMax |
|
template<typename Dst , typename Src > |
constexpr Dst | kCommonMin |
|