convert some traits to cleaner syntax

master
Daniel Kolesa 2016-01-14 18:49:38 +00:00
parent 1c5ba28f35
commit 7d52a75348
1 changed files with 26 additions and 26 deletions

View File

@ -126,59 +126,59 @@ constexpr bool IsNullPointer = IsSame<RemoveCv<T>, Nullptr>;
/* is integer */ /* is integer */
namespace detail { namespace detail {
template<typename T> struct IsIntegralBase: False {}; template<typename> constexpr bool IsIntegralBase = false;
template<> struct IsIntegralBase<bool >: True {}; template<> constexpr bool IsIntegralBase<bool > = true;
template<> struct IsIntegralBase<char >: True {}; template<> constexpr bool IsIntegralBase<char > = true;
template<> struct IsIntegralBase<short >: True {}; template<> constexpr bool IsIntegralBase<short > = true;
template<> struct IsIntegralBase<int >: True {}; template<> constexpr bool IsIntegralBase<int > = true;
template<> struct IsIntegralBase<long >: True {}; template<> constexpr bool IsIntegralBase<long > = true;
template<> struct IsIntegralBase<sbyte >: True {}; template<> constexpr bool IsIntegralBase<sbyte > = true;
template<> struct IsIntegralBase<byte >: True {}; template<> constexpr bool IsIntegralBase<byte > = true;
template<> struct IsIntegralBase<ushort>: True {}; template<> constexpr bool IsIntegralBase<ushort> = true;
template<> struct IsIntegralBase<uint >: True {}; template<> constexpr bool IsIntegralBase<uint > = true;
template<> struct IsIntegralBase<ulong >: True {}; template<> constexpr bool IsIntegralBase<ulong > = true;
template<> struct IsIntegralBase<llong >: True {}; template<> constexpr bool IsIntegralBase<llong > = true;
template<> struct IsIntegralBase<ullong>: True {}; template<> constexpr bool IsIntegralBase<ullong> = true;
template<> struct IsIntegralBase<Char16>: True {}; template<> constexpr bool IsIntegralBase<Char16> = true;
template<> struct IsIntegralBase<Char32>: True {}; template<> constexpr bool IsIntegralBase<Char32> = true;
template<> struct IsIntegralBase<Wchar >: True {}; template<> constexpr bool IsIntegralBase<Wchar > = true;
} }
template<typename T> template<typename T>
constexpr bool IsIntegral = detail::IsIntegralBase<RemoveCv<T>>::value; constexpr bool IsIntegral = detail::IsIntegralBase<RemoveCv<T>>;
/* is floating point */ /* is floating point */
namespace detail { namespace detail {
template<typename T> struct IsFloatingPointBase: False {}; template<typename> constexpr bool IsFloatingPointBase = false;
template<> struct IsFloatingPointBase<float >: True {}; template<> constexpr bool IsFloatingPointBase<float > = true;
template<> struct IsFloatingPointBase<double>: True {}; template<> constexpr bool IsFloatingPointBase<double> = true;
template<> struct IsFloatingPointBase<ldouble>: True {}; template<> constexpr bool IsFloatingPointBase<ldouble> = true;
} }
template<typename T> template<typename T>
constexpr bool IsFloatingPoint = detail::IsFloatingPointBase<RemoveCv<T>>::value; constexpr bool IsFloatingPoint = detail::IsFloatingPointBase<RemoveCv<T>>;
/* is array */ /* is array */
template<typename > constexpr bool IsArray = false; template<typename > constexpr bool IsArray = false;
template<typename T > constexpr bool IsArray<T[]> = true; template<typename T > constexpr bool IsArray<T[ ]> = true;
template<typename T, Size N> constexpr bool IsArray<T[N]> = true; template<typename T, Size N> constexpr bool IsArray<T[N]> = true;
/* is pointer */ /* is pointer */
namespace detail { namespace detail {
template<typename > struct IsPointerBase : False {}; template<typename > constexpr bool IsPointerBase = false;
template<typename T> struct IsPointerBase<T *>: True {}; template<typename T> constexpr bool IsPointerBase<T *> = true;
} }
template<typename T> template<typename T>
constexpr bool IsPointer = detail::IsPointerBase<RemoveCv<T>>::value; constexpr bool IsPointer = detail::IsPointerBase<RemoveCv<T>>;
/* is lvalue reference */ /* is lvalue reference */