32 #ifndef _CPP_TYPE_TRAITS_H 33 #define _CPP_TYPE_TRAITS_H 1 35 #pragma GCC system_header 69 namespace std _GLIBCXX_VISIBILITY(default)
71 _GLIBCXX_BEGIN_NAMESPACE_VERSION
73 struct __true_type { };
74 struct __false_type { };
78 {
typedef __false_type __type; };
81 struct __truth_type<true>
82 {
typedef __true_type __type; };
86 template<
class _Sp,
class _Tp>
89 enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
90 typedef typename __truth_type<__value>::__type __type;
94 template<
typename,
typename>
98 typedef __false_type __type;
101 template<
typename _Tp>
102 struct __are_same<_Tp, _Tp>
104 enum { __value = 1 };
105 typedef __true_type __type;
109 template<
typename _Tp>
112 enum { __value = 0 };
113 typedef __false_type __type;
117 struct __is_void<void>
119 enum { __value = 1 };
120 typedef __true_type __type;
126 template<
typename _Tp>
129 enum { __value = 0 };
130 typedef __false_type __type;
138 struct __is_integer<bool>
140 enum { __value = 1 };
141 typedef __true_type __type;
145 struct __is_integer<char>
147 enum { __value = 1 };
148 typedef __true_type __type;
152 struct __is_integer<signed char>
154 enum { __value = 1 };
155 typedef __true_type __type;
159 struct __is_integer<unsigned char>
161 enum { __value = 1 };
162 typedef __true_type __type;
165 # ifdef _GLIBCXX_USE_WCHAR_T 167 struct __is_integer<wchar_t>
169 enum { __value = 1 };
170 typedef __true_type __type;
174 #if __cplusplus >= 201103L 176 struct __is_integer<char16_t>
178 enum { __value = 1 };
179 typedef __true_type __type;
183 struct __is_integer<char32_t>
185 enum { __value = 1 };
186 typedef __true_type __type;
191 struct __is_integer<short>
193 enum { __value = 1 };
194 typedef __true_type __type;
198 struct __is_integer<unsigned short>
200 enum { __value = 1 };
201 typedef __true_type __type;
205 struct __is_integer<int>
207 enum { __value = 1 };
208 typedef __true_type __type;
212 struct __is_integer<unsigned int>
214 enum { __value = 1 };
215 typedef __true_type __type;
219 struct __is_integer<long>
221 enum { __value = 1 };
222 typedef __true_type __type;
226 struct __is_integer<unsigned long>
228 enum { __value = 1 };
229 typedef __true_type __type;
233 struct __is_integer<long long>
235 enum { __value = 1 };
236 typedef __true_type __type;
240 struct __is_integer<unsigned long long>
242 enum { __value = 1 };
243 typedef __true_type __type;
246 #define __INT_N(TYPE) \ 248 struct __is_integer<TYPE> \ 250 enum { __value = 1 }; \ 251 typedef __true_type __type; \ 254 struct __is_integer<unsigned TYPE> \ 256 enum { __value = 1 }; \ 257 typedef __true_type __type; \ 260 #ifdef __GLIBCXX_TYPE_INT_N_0 261 __INT_N(__GLIBCXX_TYPE_INT_N_0)
263 #ifdef __GLIBCXX_TYPE_INT_N_1 264 __INT_N(__GLIBCXX_TYPE_INT_N_1)
266 #ifdef __GLIBCXX_TYPE_INT_N_2 267 __INT_N(__GLIBCXX_TYPE_INT_N_2)
269 #ifdef __GLIBCXX_TYPE_INT_N_3 270 __INT_N(__GLIBCXX_TYPE_INT_N_3)
278 template<
typename _Tp>
281 enum { __value = 0 };
282 typedef __false_type __type;
287 struct __is_floating<float>
289 enum { __value = 1 };
290 typedef __true_type __type;
294 struct __is_floating<double>
296 enum { __value = 1 };
297 typedef __true_type __type;
301 struct __is_floating<long double>
303 enum { __value = 1 };
304 typedef __true_type __type;
310 template<
typename _Tp>
313 enum { __value = 0 };
314 typedef __false_type __type;
317 template<
typename _Tp>
318 struct __is_pointer<_Tp*>
320 enum { __value = 1 };
321 typedef __true_type __type;
327 template<
typename _Tp>
328 struct __is_arithmetic
329 :
public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
335 template<
typename _Tp>
337 :
public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
343 template<
typename _Tp>
346 enum { __value = 0 };
347 typedef __false_type __type;
351 struct __is_char<char>
353 enum { __value = 1 };
354 typedef __true_type __type;
357 #ifdef _GLIBCXX_USE_WCHAR_T 359 struct __is_char<wchar_t>
361 enum { __value = 1 };
362 typedef __true_type __type;
366 template<
typename _Tp>
369 enum { __value = 0 };
370 typedef __false_type __type;
374 struct __is_byte<char>
376 enum { __value = 1 };
377 typedef __true_type __type;
381 struct __is_byte<signed char>
383 enum { __value = 1 };
384 typedef __true_type __type;
388 struct __is_byte<unsigned char>
390 enum { __value = 1 };
391 typedef __true_type __type;
394 #if __cplusplus >= 201703L 395 enum class byte : unsigned char;
398 struct __is_byte<byte>
400 enum { __value = 1 };
401 typedef __true_type __type;
408 template<
typename _Tp>
409 struct __is_move_iterator
411 enum { __value = 0 };
412 typedef __false_type __type;
417 template<
typename _Iterator>
419 __miter_base(_Iterator __it)
422 _GLIBCXX_END_NAMESPACE_VERSION
426 #endif //_CPP_TYPE_TRAITS_H
ISO C++ entities toplevel namespace is std.