32#ifndef _CPP_TYPE_TRAITS_H
33#define _CPP_TYPE_TRAITS_H 1
35#pragma GCC system_header
70namespace std _GLIBCXX_VISIBILITY(default)
72_GLIBCXX_BEGIN_NAMESPACE_VERSION
74 struct __true_type { };
75 struct __false_type { };
79 {
typedef __false_type __type; };
82 struct __truth_type<true>
83 {
typedef __true_type __type; };
87 template<
class _Sp,
class _Tp>
90 enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
91 typedef typename __truth_type<__value>::__type __type;
95 template<
typename,
typename>
99 typedef __false_type __type;
102 template<
typename _Tp>
103 struct __are_same<_Tp, _Tp>
105 enum { __value = 1 };
106 typedef __true_type __type;
110 template<
typename _Tp>
113 enum { __value = 0 };
114 typedef __false_type __type;
118 struct __is_void<void>
120 enum { __value = 1 };
121 typedef __true_type __type;
127 template<
typename _Tp>
130 enum { __value = 0 };
131 typedef __false_type __type;
139 struct __is_integer<bool>
141 enum { __value = 1 };
142 typedef __true_type __type;
146 struct __is_integer<char>
148 enum { __value = 1 };
149 typedef __true_type __type;
153 struct __is_integer<signed char>
155 enum { __value = 1 };
156 typedef __true_type __type;
160 struct __is_integer<unsigned char>
162 enum { __value = 1 };
163 typedef __true_type __type;
166# ifdef __WCHAR_TYPE__
168 struct __is_integer<wchar_t>
170 enum { __value = 1 };
171 typedef __true_type __type;
175#ifdef _GLIBCXX_USE_CHAR8_T
177 struct __is_integer<char8_t>
179 enum { __value = 1 };
180 typedef __true_type __type;
184#if __cplusplus >= 201103L
186 struct __is_integer<char16_t>
188 enum { __value = 1 };
189 typedef __true_type __type;
193 struct __is_integer<char32_t>
195 enum { __value = 1 };
196 typedef __true_type __type;
201 struct __is_integer<short>
203 enum { __value = 1 };
204 typedef __true_type __type;
208 struct __is_integer<unsigned short>
210 enum { __value = 1 };
211 typedef __true_type __type;
215 struct __is_integer<int>
217 enum { __value = 1 };
218 typedef __true_type __type;
222 struct __is_integer<unsigned int>
224 enum { __value = 1 };
225 typedef __true_type __type;
229 struct __is_integer<long>
231 enum { __value = 1 };
232 typedef __true_type __type;
236 struct __is_integer<unsigned long>
238 enum { __value = 1 };
239 typedef __true_type __type;
243 struct __is_integer<long long>
245 enum { __value = 1 };
246 typedef __true_type __type;
250 struct __is_integer<unsigned long long>
252 enum { __value = 1 };
253 typedef __true_type __type;
256#define __INT_N(TYPE) \
259 struct __is_integer<TYPE> \
261 enum { __value = 1 }; \
262 typedef __true_type __type; \
266 struct __is_integer<unsigned TYPE> \
268 enum { __value = 1 }; \
269 typedef __true_type __type; \
272#ifdef __GLIBCXX_TYPE_INT_N_0
273__INT_N(__GLIBCXX_TYPE_INT_N_0)
275#ifdef __GLIBCXX_TYPE_INT_N_1
276__INT_N(__GLIBCXX_TYPE_INT_N_1)
278#ifdef __GLIBCXX_TYPE_INT_N_2
279__INT_N(__GLIBCXX_TYPE_INT_N_2)
281#ifdef __GLIBCXX_TYPE_INT_N_3
282__INT_N(__GLIBCXX_TYPE_INT_N_3)
290 template<
typename _Tp>
293 enum { __value = 0 };
294 typedef __false_type __type;
299 struct __is_floating<float>
301 enum { __value = 1 };
302 typedef __true_type __type;
306 struct __is_floating<double>
308 enum { __value = 1 };
309 typedef __true_type __type;
313 struct __is_floating<long double>
315 enum { __value = 1 };
316 typedef __true_type __type;
319#ifdef __STDCPP_FLOAT16_T__
321 struct __is_floating<_Float16>
323 enum { __value = 1 };
324 typedef __true_type __type;
328#ifdef __STDCPP_FLOAT32_T__
330 struct __is_floating<_Float32>
332 enum { __value = 1 };
333 typedef __true_type __type;
337#ifdef __STDCPP_FLOAT64_T__
339 struct __is_floating<_Float64>
341 enum { __value = 1 };
342 typedef __true_type __type;
346#ifdef __STDCPP_FLOAT128_T__
348 struct __is_floating<_Float128>
350 enum { __value = 1 };
351 typedef __true_type __type;
355#ifdef __STDCPP_BFLOAT16_T__
357 struct __is_floating<
__gnu_cxx::__bfloat16_t>
359 enum { __value = 1 };
360 typedef __true_type __type;
367 template<
typename _Tp>
370 enum { __value = 0 };
371 typedef __false_type __type;
374 template<
typename _Tp>
375 struct __is_pointer<_Tp*>
377 enum { __value = 1 };
378 typedef __true_type __type;
384 template<
typename _Tp>
385 struct __is_arithmetic
386 :
public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
392 template<
typename _Tp>
394 :
public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
400 template<
typename _Tp>
403 enum { __value = 0 };
404 typedef __false_type __type;
408 struct __is_char<char>
410 enum { __value = 1 };
411 typedef __true_type __type;
416 struct __is_char<wchar_t>
418 enum { __value = 1 };
419 typedef __true_type __type;
423 template<
typename _Tp>
426 enum { __value = 0 };
427 typedef __false_type __type;
431 struct __is_byte<char>
433 enum { __value = 1 };
434 typedef __true_type __type;
438 struct __is_byte<signed char>
440 enum { __value = 1 };
441 typedef __true_type __type;
445 struct __is_byte<unsigned char>
447 enum { __value = 1 };
448 typedef __true_type __type;
452 enum class byte :
unsigned char;
455 struct __is_byte<byte>
457 enum { __value = 1 };
458 typedef __true_type __type;
462#ifdef _GLIBCXX_USE_CHAR8_T
464 struct __is_byte<char8_t>
466 enum { __value = 1 };
467 typedef __true_type __type;
471 template<
typename>
struct iterator_traits;
474 template<
typename _Tp>
475 struct __is_nonvolatile_trivially_copyable
477 enum { __value = __is_trivially_copyable(_Tp) };
483 template<
typename _Tp>
484 struct __is_nonvolatile_trivially_copyable<volatile _Tp>
486 enum { __value = 0 };
490 template<
typename _OutputIter,
typename _InputIter>
493 enum { __value = 0 };
496 template<
typename _Tp>
497 struct __memcpyable<_Tp*, _Tp*>
498 : __is_nonvolatile_trivially_copyable<_Tp>
501 template<
typename _Tp>
502 struct __memcpyable<_Tp*,
const _Tp*>
503 : __is_nonvolatile_trivially_copyable<_Tp>
511 template<
typename _Iter1,
typename _Iter2>
514 enum { __value = 0 };
518 template<
typename _Tp>
519 struct __memcmpable<_Tp*, _Tp*>
520 : __is_nonvolatile_trivially_copyable<_Tp>
523 template<
typename _Tp>
524 struct __memcmpable<const _Tp*, _Tp*>
525 : __is_nonvolatile_trivially_copyable<_Tp>
528 template<
typename _Tp>
529 struct __memcmpable<_Tp*,
const _Tp*>
530 : __is_nonvolatile_trivially_copyable<_Tp>
539 template<
typename _Tp,
bool _TreatAsBytes =
540#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
541 __is_integer<_Tp>::__value
543 __is_byte<_Tp>::__value
546 struct __is_memcmp_ordered
548 static const bool __value = _Tp(-1) > _Tp(1);
551 template<
typename _Tp>
552 struct __is_memcmp_ordered<_Tp, false>
554 static const bool __value =
false;
558 template<
typename _Tp,
typename _Up,
bool = sizeof(_Tp) == sizeof(_Up)>
559 struct __is_memcmp_ordered_with
561 static const bool __value = __is_memcmp_ordered<_Tp>::__value
562 && __is_memcmp_ordered<_Up>::__value;
565 template<
typename _Tp,
typename _Up>
566 struct __is_memcmp_ordered_with<_Tp, _Up, false>
568 static const bool __value =
false;
571#if __cplusplus >= 201703L
572#if __BYTE_ORDER__ == __ORDER_BIG_ENDIAN__
575 struct __is_memcmp_ordered<
std::byte, false>
576 {
static constexpr bool __value =
true; };
581 struct __is_memcmp_ordered_with<
std::byte, std::byte, true>
582 {
static constexpr bool __value =
true; };
584 template<
typename _Tp,
bool _SameSize>
585 struct __is_memcmp_ordered_with<_Tp,
std::byte, _SameSize>
586 {
static constexpr bool __value =
false; };
588 template<
typename _Up,
bool _SameSize>
589 struct __is_memcmp_ordered_with<
std::byte, _Up, _SameSize>
590 {
static constexpr bool __value =
false; };
596 template<
typename _Tp>
597 struct __is_move_iterator
599 enum { __value = 0 };
600 typedef __false_type __type;
605 template<
typename _Iterator>
608 __miter_base(_Iterator __it)
611_GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
GNU extensions for public use.