35 #ifndef EASTL_INTERNAL_TYPE_PROPERTIES_H 36 #define EASTL_INTERNAL_TYPE_PROPERTIES_H 54 template <
typename T>
struct is_const_value :
public false_type{};
55 template <
typename T>
struct is_const_value<const T*> :
public true_type{};
56 template <
typename T>
struct is_const_value<const volatile T*> :
public true_type{};
58 template <
typename T>
struct is_const :
public is_const_value<T*>{};
59 template <
typename T>
struct is_const<T&> :
public false_type{};
70 template <
typename T>
struct is_volatile_value :
public false_type{};
71 template <
typename T>
struct is_volatile_value<volatile T*> :
public true_type{};
72 template <
typename T>
struct is_volatile_value<const volatile T*> :
public true_type{};
74 template <
typename T>
struct is_volatile :
public is_volatile_value<T*>{};
75 template <
typename T>
struct is_volatile<T&> :
public false_type{};
108 template <
typename T>
struct is_signed :
public false_type{};
110 template <>
struct is_signed<signed char> :
public true_type{};
111 template <>
struct is_signed<const signed char> :
public true_type{};
112 template <>
struct is_signed<signed short> :
public true_type{};
113 template <>
struct is_signed<const signed short> :
public true_type{};
114 template <>
struct is_signed<signed int> :
public true_type{};
115 template <>
struct is_signed<const signed int> :
public true_type{};
116 template <>
struct is_signed<signed long> :
public true_type{};
117 template <>
struct is_signed<const signed long> :
public true_type{};
118 template <>
struct is_signed<signed long long> :
public true_type{};
119 template <>
struct is_signed<const signed long long> :
public true_type{};
121 #if (CHAR_MAX == SCHAR_MAX) 122 template <>
struct is_signed<char> :
public true_type{};
123 template <>
struct is_signed<const char> :
public true_type{};
125 #ifndef EA_WCHAR_T_NON_NATIVE // If wchar_t is a native type instead of simply a define to an existing type... 126 #if defined(__WCHAR_MAX__) && ((__WCHAR_MAX__ == 2147483647) || (__WCHAR_MAX__ == 32767)) // GCC defines __WCHAR_MAX__ for most platforms. 127 template <>
struct is_signed<wchar_t> :
public true_type{};
128 template <>
struct is_signed<const wchar_t> :
public true_type{};
132 #define EASTL_DECLARE_SIGNED(T) namespace eastl{ template <> struct is_signed<T> : public true_type{}; template <> struct is_signed<const T> : public true_type{}; } 152 template <
typename T>
struct is_unsigned :
public false_type{};
154 template <>
struct is_unsigned<unsigned char> :
public true_type{};
155 template <>
struct is_unsigned<const unsigned char> :
public true_type{};
156 template <>
struct is_unsigned<unsigned short> :
public true_type{};
157 template <>
struct is_unsigned<const unsigned short> :
public true_type{};
158 template <>
struct is_unsigned<unsigned int> :
public true_type{};
159 template <>
struct is_unsigned<const unsigned int> :
public true_type{};
160 template <>
struct is_unsigned<unsigned long> :
public true_type{};
161 template <>
struct is_unsigned<const unsigned long> :
public true_type{};
162 template <>
struct is_unsigned<unsigned long long> :
public true_type{};
163 template <>
struct is_unsigned<const unsigned long long> :
public true_type{};
165 #if (CHAR_MAX == UCHAR_MAX) 166 template <>
struct is_unsigned<char> :
public true_type{};
167 template <>
struct is_unsigned<const char> :
public true_type{};
169 #ifndef EA_WCHAR_T_NON_NATIVE // If wchar_t is a native type instead of simply a define to an existing type... 170 #if defined(_MSC_VER) || (defined(__WCHAR_MAX__) && ((__WCHAR_MAX__ == 4294967295U) || (__WCHAR_MAX__ == 65535))) // GCC defines __WCHAR_MAX__ for most platforms. 171 template <>
struct is_unsigned<wchar_t> :
public true_type{};
172 template <>
struct is_unsigned<const wchar_t> :
public true_type{};
176 #define EASTL_DECLARE_UNSIGNED(T) namespace eastl{ template <> struct is_unsigned<T> : public true_type{}; template <> struct is_unsigned<const T> : public true_type{}; } 189 template <
typename T>
190 struct alignment_of_value{
static const size_t value = EASTL_ALIGN_OF(T); };
192 template <
typename T>
193 struct alignment_of :
public integral_constant<size_t, alignment_of_value<T>::value>{};
204 template <
typename T>
205 struct is_aligned_value{
static const bool value = (EASTL_ALIGN_OF(T) > 8); };
207 template <
typename T>
208 struct is_aligned :
public integral_constant<bool, is_aligned_value<T>::value>{};
263 #endif // Header include guard EA Standard Template Library.