diff --git a/libc/utils/CPP/TypeTraits.h b/libc/utils/CPP/TypeTraits.h --- a/libc/utils/CPP/TypeTraits.h +++ b/libc/utils/CPP/TypeTraits.h @@ -26,27 +26,12 @@ static constexpr bool Value = false; }; -template struct IsIntegral : public FalseValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; -template <> struct IsIntegral : public TrueValue {}; - -template struct IsPointerType : public FalseValue {}; -template struct IsPointerType : public TrueValue {}; +template struct TypeIdentity { typedef T Type; }; template struct IsSame : public FalseValue {}; template struct IsSame : public TrueValue {}; - -template struct TypeIdentity { typedef T Type; }; +template +constexpr bool IsSameV = IsSame::Value; template struct RemoveCV : public TypeIdentity {}; template struct RemoveCV : public TypeIdentity {}; @@ -56,6 +41,28 @@ template using RemoveCVType = typename RemoveCV::Type; +template struct IsIntegral { + static constexpr bool Value = + IsSameV> || + IsSameV> || + IsSameV> || + IsSameV> || + IsSameV> || + IsSameV> || + IsSameV> || + IsSameV> || + IsSameV> || + IsSameV> || + IsSameV> || + IsSameV>; +}; + +template struct IsPointerTypeNoQual : public FalseValue {}; +template struct IsPointerTypeNoQual : public TrueValue {}; +template struct IsPointerType { + static constexpr bool Value = IsPointerTypeNoQual>::Value; +}; + template struct IsFloatingPointType { static constexpr bool Value = IsSame>::Value || IsSame>::Value ||