libstdc++
type_traits
Go to the documentation of this file.
1 // C++11 <type_traits> -*- C++ -*-
2 
3 // Copyright (C) 2007-2014 Free Software Foundation, Inc.
4 //
5 // This file is part of the GNU ISO C++ Library. This library is free
6 // software; you can redistribute it and/or modify it under the
7 // terms of the GNU General Public License as published by the
8 // Free Software Foundation; either version 3, or (at your option)
9 // any later version.
10 
11 // This library is distributed in the hope that it will be useful,
12 // but WITHOUT ANY WARRANTY; without even the implied warranty of
13 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 // GNU General Public License for more details.
15 
16 // Under Section 7 of GPL version 3, you are granted additional
17 // permissions described in the GCC Runtime Library Exception, version
18 // 3.1, as published by the Free Software Foundation.
19 
20 // You should have received a copy of the GNU General Public License and
21 // a copy of the GCC Runtime Library Exception along with this program;
22 // see the files COPYING3 and COPYING.RUNTIME respectively. If not, see
23 // <http://www.gnu.org/licenses/>.
24 
25 /** @file include/type_traits
26  * This is a Standard C++ Library header.
27  */
28 
29 #ifndef _GLIBCXX_TYPE_TRAITS
30 #define _GLIBCXX_TYPE_TRAITS 1
31 
32 #pragma GCC system_header
33 
34 #if __cplusplus < 201103L
35 # include <bits/c++0x_warning.h>
36 #else
37 
38 #include <bits/c++config.h>
39 
40 namespace std _GLIBCXX_VISIBILITY(default)
41 {
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
43 
44  /**
45  * @defgroup metaprogramming Metaprogramming
46  * @ingroup utilities
47  *
48  * Template utilities for compile-time introspection and modification,
49  * including type classification traits, type property inspection traits
50  * and type transformation traits.
51  *
52  * @{
53  */
54 
55  /// integral_constant
56  template<typename _Tp, _Tp __v>
58  {
59  static constexpr _Tp value = __v;
60  typedef _Tp value_type;
62  constexpr operator value_type() const { return value; }
63 #if __cplusplus > 201103L
64  constexpr value_type operator()() const { return value; }
65 #endif
66  };
67 
68  template<typename _Tp, _Tp __v>
70 
71  /// The type used as a compile-time boolean with true value.
73 
74  /// The type used as a compile-time boolean with false value.
76 
77  // Meta programming helper types.
78 
79  template<bool, typename, typename>
80  struct conditional;
81 
82  template<typename...>
83  struct __or_;
84 
85  template<>
86  struct __or_<>
87  : public false_type
88  { };
89 
90  template<typename _B1>
91  struct __or_<_B1>
92  : public _B1
93  { };
94 
95  template<typename _B1, typename _B2>
96  struct __or_<_B1, _B2>
97  : public conditional<_B1::value, _B1, _B2>::type
98  { };
99 
100  template<typename _B1, typename _B2, typename _B3, typename... _Bn>
101  struct __or_<_B1, _B2, _B3, _Bn...>
102  : public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
103  { };
104 
105  template<typename...>
106  struct __and_;
107 
108  template<>
109  struct __and_<>
110  : public true_type
111  { };
112 
113  template<typename _B1>
114  struct __and_<_B1>
115  : public _B1
116  { };
117 
118  template<typename _B1, typename _B2>
119  struct __and_<_B1, _B2>
120  : public conditional<_B1::value, _B2, _B1>::type
121  { };
122 
123  template<typename _B1, typename _B2, typename _B3, typename... _Bn>
124  struct __and_<_B1, _B2, _B3, _Bn...>
125  : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
126  { };
127 
128  template<typename _Pp>
129  struct __not_
130  : public integral_constant<bool, !_Pp::value>
131  { };
132 
133  // For several sfinae-friendly trait implementations we transport both the
134  // result information (as the member type) and the failure information (no
135  // member type). This is very similar to std::enable_if, but we cannot use
136  // them, because we need to derive from them as an implementation detail.
137 
138  template<typename _Tp>
139  struct __success_type
140  { typedef _Tp type; };
141 
142  struct __failure_type
143  { };
144 
145  // Primary type categories.
146 
147  template<typename>
148  struct remove_cv;
149 
150  template<typename>
151  struct __is_void_helper
152  : public false_type { };
153 
154  template<>
155  struct __is_void_helper<void>
156  : public true_type { };
157 
158  /// is_void
159  template<typename _Tp>
160  struct is_void
161  : public __is_void_helper<typename remove_cv<_Tp>::type>::type
162  { };
163 
164  template<typename>
165  struct __is_integral_helper
166  : public false_type { };
167 
168  template<>
169  struct __is_integral_helper<bool>
170  : public true_type { };
171 
172  template<>
173  struct __is_integral_helper<char>
174  : public true_type { };
175 
176  template<>
177  struct __is_integral_helper<signed char>
178  : public true_type { };
179 
180  template<>
181  struct __is_integral_helper<unsigned char>
182  : public true_type { };
183 
184 #ifdef _GLIBCXX_USE_WCHAR_T
185  template<>
186  struct __is_integral_helper<wchar_t>
187  : public true_type { };
188 #endif
189 
190  template<>
191  struct __is_integral_helper<char16_t>
192  : public true_type { };
193 
194  template<>
195  struct __is_integral_helper<char32_t>
196  : public true_type { };
197 
198  template<>
199  struct __is_integral_helper<short>
200  : public true_type { };
201 
202  template<>
203  struct __is_integral_helper<unsigned short>
204  : public true_type { };
205 
206  template<>
207  struct __is_integral_helper<int>
208  : public true_type { };
209 
210  template<>
211  struct __is_integral_helper<unsigned int>
212  : public true_type { };
213 
214  template<>
215  struct __is_integral_helper<long>
216  : public true_type { };
217 
218  template<>
219  struct __is_integral_helper<unsigned long>
220  : public true_type { };
221 
222  template<>
223  struct __is_integral_helper<long long>
224  : public true_type { };
225 
226  template<>
227  struct __is_integral_helper<unsigned long long>
228  : public true_type { };
229 
230 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
231  template<>
232  struct __is_integral_helper<__int128>
233  : public true_type { };
234 
235  template<>
236  struct __is_integral_helper<unsigned __int128>
237  : public true_type { };
238 #endif
239 
240  /// is_integral
241  template<typename _Tp>
242  struct is_integral
243  : public __is_integral_helper<typename remove_cv<_Tp>::type>::type
244  { };
245 
246  template<typename>
247  struct __is_floating_point_helper
248  : public false_type { };
249 
250  template<>
251  struct __is_floating_point_helper<float>
252  : public true_type { };
253 
254  template<>
255  struct __is_floating_point_helper<double>
256  : public true_type { };
257 
258  template<>
259  struct __is_floating_point_helper<long double>
260  : public true_type { };
261 
262 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_FLOAT128)
263  template<>
264  struct __is_floating_point_helper<__float128>
265  : public true_type { };
266 #endif
267 
268  /// is_floating_point
269  template<typename _Tp>
271  : public __is_floating_point_helper<typename remove_cv<_Tp>::type>::type
272  { };
273 
274  /// is_array
275  template<typename>
276  struct is_array
277  : public false_type { };
278 
279  template<typename _Tp, std::size_t _Size>
280  struct is_array<_Tp[_Size]>
281  : public true_type { };
282 
283  template<typename _Tp>
284  struct is_array<_Tp[]>
285  : public true_type { };
286 
287  template<typename>
288  struct __is_pointer_helper
289  : public false_type { };
290 
291  template<typename _Tp>
292  struct __is_pointer_helper<_Tp*>
293  : public true_type { };
294 
295  /// is_pointer
296  template<typename _Tp>
297  struct is_pointer
298  : public __is_pointer_helper<typename remove_cv<_Tp>::type>::type
299  { };
300 
301  /// is_lvalue_reference
302  template<typename>
304  : public false_type { };
305 
306  template<typename _Tp>
307  struct is_lvalue_reference<_Tp&>
308  : public true_type { };
309 
310  /// is_rvalue_reference
311  template<typename>
313  : public false_type { };
314 
315  template<typename _Tp>
316  struct is_rvalue_reference<_Tp&&>
317  : public true_type { };
318 
319  template<typename>
320  struct is_function;
321 
322  template<typename>
323  struct __is_member_object_pointer_helper
324  : public false_type { };
325 
326  template<typename _Tp, typename _Cp>
327  struct __is_member_object_pointer_helper<_Tp _Cp::*>
328  : public integral_constant<bool, !is_function<_Tp>::value> { };
329 
330  /// is_member_object_pointer
331  template<typename _Tp>
333  : public __is_member_object_pointer_helper<
334  typename remove_cv<_Tp>::type>::type
335  { };
336 
337  template<typename>
338  struct __is_member_function_pointer_helper
339  : public false_type { };
340 
341  template<typename _Tp, typename _Cp>
342  struct __is_member_function_pointer_helper<_Tp _Cp::*>
343  : public integral_constant<bool, is_function<_Tp>::value> { };
344 
345  /// is_member_function_pointer
346  template<typename _Tp>
348  : public __is_member_function_pointer_helper<
349  typename remove_cv<_Tp>::type>::type
350  { };
351 
352  /// is_enum
353  template<typename _Tp>
354  struct is_enum
355  : public integral_constant<bool, __is_enum(_Tp)>
356  { };
357 
358  /// is_union
359  template<typename _Tp>
360  struct is_union
361  : public integral_constant<bool, __is_union(_Tp)>
362  { };
363 
364  /// is_class
365  template<typename _Tp>
366  struct is_class
367  : public integral_constant<bool, __is_class(_Tp)>
368  { };
369 
370  /// is_function
371  template<typename>
372  struct is_function
373  : public false_type { };
374 
375  template<typename _Res, typename... _ArgTypes>
376  struct is_function<_Res(_ArgTypes...)>
377  : public true_type { };
378 
379  template<typename _Res, typename... _ArgTypes>
380  struct is_function<_Res(_ArgTypes...) &>
381  : public true_type { };
382 
383  template<typename _Res, typename... _ArgTypes>
384  struct is_function<_Res(_ArgTypes...) &&>
385  : public true_type { };
386 
387  template<typename _Res, typename... _ArgTypes>
388  struct is_function<_Res(_ArgTypes......)>
389  : public true_type { };
390 
391  template<typename _Res, typename... _ArgTypes>
392  struct is_function<_Res(_ArgTypes......) &>
393  : public true_type { };
394 
395  template<typename _Res, typename... _ArgTypes>
396  struct is_function<_Res(_ArgTypes......) &&>
397  : public true_type { };
398 
399  template<typename _Res, typename... _ArgTypes>
400  struct is_function<_Res(_ArgTypes...) const>
401  : public true_type { };
402 
403  template<typename _Res, typename... _ArgTypes>
404  struct is_function<_Res(_ArgTypes...) const &>
405  : public true_type { };
406 
407  template<typename _Res, typename... _ArgTypes>
408  struct is_function<_Res(_ArgTypes...) const &&>
409  : public true_type { };
410 
411  template<typename _Res, typename... _ArgTypes>
412  struct is_function<_Res(_ArgTypes......) const>
413  : public true_type { };
414 
415  template<typename _Res, typename... _ArgTypes>
416  struct is_function<_Res(_ArgTypes......) const &>
417  : public true_type { };
418 
419  template<typename _Res, typename... _ArgTypes>
420  struct is_function<_Res(_ArgTypes......) const &&>
421  : public true_type { };
422 
423  template<typename _Res, typename... _ArgTypes>
424  struct is_function<_Res(_ArgTypes...) volatile>
425  : public true_type { };
426 
427  template<typename _Res, typename... _ArgTypes>
428  struct is_function<_Res(_ArgTypes...) volatile &>
429  : public true_type { };
430 
431  template<typename _Res, typename... _ArgTypes>
432  struct is_function<_Res(_ArgTypes...) volatile &&>
433  : public true_type { };
434 
435  template<typename _Res, typename... _ArgTypes>
436  struct is_function<_Res(_ArgTypes......) volatile>
437  : public true_type { };
438 
439  template<typename _Res, typename... _ArgTypes>
440  struct is_function<_Res(_ArgTypes......) volatile &>
441  : public true_type { };
442 
443  template<typename _Res, typename... _ArgTypes>
444  struct is_function<_Res(_ArgTypes......) volatile &&>
445  : public true_type { };
446 
447  template<typename _Res, typename... _ArgTypes>
448  struct is_function<_Res(_ArgTypes...) const volatile>
449  : public true_type { };
450 
451  template<typename _Res, typename... _ArgTypes>
452  struct is_function<_Res(_ArgTypes...) const volatile &>
453  : public true_type { };
454 
455  template<typename _Res, typename... _ArgTypes>
456  struct is_function<_Res(_ArgTypes...) const volatile &&>
457  : public true_type { };
458 
459  template<typename _Res, typename... _ArgTypes>
460  struct is_function<_Res(_ArgTypes......) const volatile>
461  : public true_type { };
462 
463  template<typename _Res, typename... _ArgTypes>
464  struct is_function<_Res(_ArgTypes......) const volatile &>
465  : public true_type { };
466 
467  template<typename _Res, typename... _ArgTypes>
468  struct is_function<_Res(_ArgTypes......) const volatile &&>
469  : public true_type { };
470 
471  template<typename>
472  struct __is_null_pointer_helper
473  : public false_type { };
474 
475  template<>
476  struct __is_null_pointer_helper<std::nullptr_t>
477  : public true_type { };
478 
479  /// is_null_pointer (LWG 2247).
480  template<typename _Tp>
482  : public __is_null_pointer_helper<typename remove_cv<_Tp>::type>::type
483  { };
484 
485  /// __is_nullptr_t (extension).
486  template<typename _Tp>
488  : public is_null_pointer<_Tp>
489  { };
490 
491  // Composite type categories.
492 
493  /// is_reference
494  template<typename _Tp>
496  : public __or_<is_lvalue_reference<_Tp>,
497  is_rvalue_reference<_Tp>>::type
498  { };
499 
500  /// is_arithmetic
501  template<typename _Tp>
503  : public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
504  { };
505 
506  /// is_fundamental
507  template<typename _Tp>
509  : public __or_<is_arithmetic<_Tp>, is_void<_Tp>,
510  is_null_pointer<_Tp>>::type
511  { };
512 
513  /// is_object
514  template<typename _Tp>
515  struct is_object
516  : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
517  is_void<_Tp>>>::type
518  { };
519 
520  template<typename>
522 
523  /// is_scalar
524  template<typename _Tp>
525  struct is_scalar
526  : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
527  is_member_pointer<_Tp>, is_null_pointer<_Tp>>::type
528  { };
529 
530  /// is_compound
531  template<typename _Tp>
532  struct is_compound
533  : public integral_constant<bool, !is_fundamental<_Tp>::value> { };
534 
535  template<typename _Tp>
536  struct __is_member_pointer_helper
537  : public false_type { };
538 
539  template<typename _Tp, typename _Cp>
540  struct __is_member_pointer_helper<_Tp _Cp::*>
541  : public true_type { };
542 
543  /// is_member_pointer
544  template<typename _Tp>
545  struct is_member_pointer
546  : public __is_member_pointer_helper<typename remove_cv<_Tp>::type>::type
547  { };
548 
549  // Utility to detect referenceable types ([defns.referenceable]).
550 
551  template<typename _Tp>
552  struct __is_referenceable
553  : public __or_<is_object<_Tp>, is_reference<_Tp>>::type
554  { };
555 
556  template<typename _Res, typename... _Args>
557  struct __is_referenceable<_Res(_Args...)>
558  : public true_type
559  { };
560 
561  template<typename _Res, typename... _Args>
562  struct __is_referenceable<_Res(_Args......)>
563  : public true_type
564  { };
565 
566  // Type properties.
567 
568  /// is_const
569  template<typename>
570  struct is_const
571  : public false_type { };
572 
573  template<typename _Tp>
574  struct is_const<_Tp const>
575  : public true_type { };
576 
577  /// is_volatile
578  template<typename>
579  struct is_volatile
580  : public false_type { };
581 
582  template<typename _Tp>
583  struct is_volatile<_Tp volatile>
584  : public true_type { };
585 
586  /// is_trivial
587  template<typename _Tp>
588  struct is_trivial
589  : public integral_constant<bool, __is_trivial(_Tp)>
590  { };
591 
592  // is_trivially_copyable (still unimplemented)
593 
594  /// is_standard_layout
595  template<typename _Tp>
597  : public integral_constant<bool, __is_standard_layout(_Tp)>
598  { };
599 
600  /// is_pod
601  // Could use is_standard_layout && is_trivial instead of the builtin.
602  template<typename _Tp>
603  struct is_pod
604  : public integral_constant<bool, __is_pod(_Tp)>
605  { };
606 
607  /// is_literal_type
608  template<typename _Tp>
610  : public integral_constant<bool, __is_literal_type(_Tp)>
611  { };
612 
613  /// is_empty
614  template<typename _Tp>
615  struct is_empty
616  : public integral_constant<bool, __is_empty(_Tp)>
617  { };
618 
619  /// is_polymorphic
620  template<typename _Tp>
622  : public integral_constant<bool, __is_polymorphic(_Tp)>
623  { };
624 
625  /// is_abstract
626  template<typename _Tp>
627  struct is_abstract
628  : public integral_constant<bool, __is_abstract(_Tp)>
629  { };
630 
631  template<typename _Tp,
633  struct __is_signed_helper
634  : public false_type { };
635 
636  template<typename _Tp>
637  struct __is_signed_helper<_Tp, true>
638  : public integral_constant<bool, _Tp(-1) < _Tp(0)>
639  { };
640 
641  /// is_signed
642  template<typename _Tp>
643  struct is_signed
644  : public __is_signed_helper<_Tp>::type
645  { };
646 
647  /// is_unsigned
648  template<typename _Tp>
649  struct is_unsigned
650  : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
651  { };
652 
653 
654  // Destructible and constructible type properties.
655 
656  template<typename>
657  struct add_rvalue_reference;
658 
659  /**
660  * @brief Utility to simplify expressions used in unevaluated operands
661  * @ingroup utilities
662  */
663  template<typename _Tp>
664  typename add_rvalue_reference<_Tp>::type declval() noexcept;
665 
666  template<typename, unsigned = 0>
667  struct extent;
668 
669  template<typename>
670  struct remove_all_extents;
671 
672  template<typename _Tp>
673  struct __is_array_known_bounds
674  : public integral_constant<bool, (extent<_Tp>::value > 0)>
675  { };
676 
677  template<typename _Tp>
678  struct __is_array_unknown_bounds
679  : public __and_<is_array<_Tp>, __not_<extent<_Tp>>>::type
680  { };
681 
682  // In N3290 is_destructible does not say anything about function
683  // types and abstract types, see LWG 2049. This implementation
684  // describes function types as non-destructible and all complete
685  // object types as destructible, iff the explicit destructor
686  // call expression is wellformed.
687  struct __do_is_destructible_impl
688  {
689  template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
690  static true_type __test(int);
691 
692  template<typename>
693  static false_type __test(...);
694  };
695 
696  template<typename _Tp>
697  struct __is_destructible_impl
698  : public __do_is_destructible_impl
699  {
700  typedef decltype(__test<_Tp>(0)) type;
701  };
702 
703  template<typename _Tp,
704  bool = __or_<is_void<_Tp>,
705  __is_array_unknown_bounds<_Tp>,
706  is_function<_Tp>>::value,
707  bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
708  struct __is_destructible_safe;
709 
710  template<typename _Tp>
711  struct __is_destructible_safe<_Tp, false, false>
712  : public __is_destructible_impl<typename
713  remove_all_extents<_Tp>::type>::type
714  { };
715 
716  template<typename _Tp>
717  struct __is_destructible_safe<_Tp, true, false>
718  : public false_type { };
719 
720  template<typename _Tp>
721  struct __is_destructible_safe<_Tp, false, true>
722  : public true_type { };
723 
724  /// is_destructible
725  template<typename _Tp>
726  struct is_destructible
727  : public __is_destructible_safe<_Tp>::type
728  { };
729 
730  // is_nothrow_destructible requires that is_destructible is
731  // satisfied as well. We realize that by mimicing the
732  // implementation of is_destructible but refer to noexcept(expr)
733  // instead of decltype(expr).
734  struct __do_is_nt_destructible_impl
735  {
736  template<typename _Tp>
737  static integral_constant<bool, noexcept(declval<_Tp&>().~_Tp())>
738  __test(int);
739 
740  template<typename>
741  static false_type __test(...);
742  };
743 
744  template<typename _Tp>
745  struct __is_nt_destructible_impl
746  : public __do_is_nt_destructible_impl
747  {
748  typedef decltype(__test<_Tp>(0)) type;
749  };
750 
751  template<typename _Tp,
752  bool = __or_<is_void<_Tp>,
753  __is_array_unknown_bounds<_Tp>,
754  is_function<_Tp>>::value,
755  bool = __or_<is_reference<_Tp>, is_scalar<_Tp>>::value>
756  struct __is_nt_destructible_safe;
757 
758  template<typename _Tp>
759  struct __is_nt_destructible_safe<_Tp, false, false>
760  : public __is_nt_destructible_impl<typename
761  remove_all_extents<_Tp>::type>::type
762  { };
763 
764  template<typename _Tp>
765  struct __is_nt_destructible_safe<_Tp, true, false>
766  : public false_type { };
767 
768  template<typename _Tp>
769  struct __is_nt_destructible_safe<_Tp, false, true>
770  : public true_type { };
771 
772  /// is_nothrow_destructible
773  template<typename _Tp>
774  struct is_nothrow_destructible
775  : public __is_nt_destructible_safe<_Tp>::type
776  { };
777 
778  struct __do_is_default_constructible_impl
779  {
780  template<typename _Tp, typename = decltype(_Tp())>
781  static true_type __test(int);
782 
783  template<typename>
784  static false_type __test(...);
785  };
786 
787  template<typename _Tp>
788  struct __is_default_constructible_impl
789  : public __do_is_default_constructible_impl
790  {
791  typedef decltype(__test<_Tp>(0)) type;
792  };
793 
794  template<typename _Tp>
795  struct __is_default_constructible_atom
796  : public __and_<__not_<is_void<_Tp>>,
797  __is_default_constructible_impl<_Tp>>::type
798  { };
799 
800  template<typename _Tp, bool = is_array<_Tp>::value>
801  struct __is_default_constructible_safe;
802 
803  // The following technique is a workaround for a current core language
804  // restriction, which does not allow for array types to occur in
805  // functional casts of the form T(). Complete arrays can be default-
806  // constructed, if the element type is default-constructible, but
807  // arrays with unknown bounds are not.
808  template<typename _Tp>
809  struct __is_default_constructible_safe<_Tp, true>
810  : public __and_<__is_array_known_bounds<_Tp>,
811  __is_default_constructible_atom<typename
812  remove_all_extents<_Tp>::type>>::type
813  { };
814 
815  template<typename _Tp>
816  struct __is_default_constructible_safe<_Tp, false>
817  : public __is_default_constructible_atom<_Tp>::type
818  { };
819 
820  /// is_default_constructible
821  template<typename _Tp>
822  struct is_default_constructible
823  : public __is_default_constructible_safe<_Tp>::type
824  { };
825 
826 
827  // Implementation of is_constructible.
828 
829  // The hardest part of this trait is the binary direct-initialization
830  // case, because we hit into a functional cast of the form T(arg).
831  // This implementation uses different strategies depending on the
832  // target type to reduce the test overhead as much as possible:
833  //
834  // a) For a reference target type, we use a static_cast expression
835  // modulo its extra cases.
836  //
837  // b) For a non-reference target type we use a ::new expression.
838  struct __do_is_static_castable_impl
839  {
840  template<typename _From, typename _To, typename
841  = decltype(static_cast<_To>(declval<_From>()))>
842  static true_type __test(int);
843 
844  template<typename, typename>
845  static false_type __test(...);
846  };
847 
848  template<typename _From, typename _To>
849  struct __is_static_castable_impl
850  : public __do_is_static_castable_impl
851  {
852  typedef decltype(__test<_From, _To>(0)) type;
853  };
854 
855  template<typename _From, typename _To>
856  struct __is_static_castable_safe
857  : public __is_static_castable_impl<_From, _To>::type
858  { };
859 
860  // __is_static_castable
861  template<typename _From, typename _To>
862  struct __is_static_castable
863  : public integral_constant<bool, (__is_static_castable_safe<
864  _From, _To>::value)>
865  { };
866 
867  // Implementation for non-reference types. To meet the proper
868  // variable definition semantics, we also need to test for
869  // is_destructible in this case.
870  // This form should be simplified by a single expression:
871  // ::delete ::new _Tp(declval<_Arg>()), see c++/51222.
872  struct __do_is_direct_constructible_impl
873  {
874  template<typename _Tp, typename _Arg, typename
875  = decltype(::new _Tp(declval<_Arg>()))>
876  static true_type __test(int);
877 
878  template<typename, typename>
879  static false_type __test(...);
880  };
881 
882  template<typename _Tp, typename _Arg>
883  struct __is_direct_constructible_impl
884  : public __do_is_direct_constructible_impl
885  {
886  typedef decltype(__test<_Tp, _Arg>(0)) type;
887  };
888 
889  template<typename _Tp, typename _Arg>
890  struct __is_direct_constructible_new_safe
891  : public __and_<is_destructible<_Tp>,
892  __is_direct_constructible_impl<_Tp, _Arg>>::type
893  { };
894 
895  template<typename, typename>
896  struct is_same;
897 
898  template<typename, typename>
899  struct is_base_of;
900 
901  template<typename>
902  struct remove_reference;
903 
904  template<typename _From, typename _To, bool
905  = __not_<__or_<is_void<_From>,
906  is_function<_From>>>::value>
907  struct __is_base_to_derived_ref;
908 
909  // Detect whether we have a downcast situation during
910  // reference binding.
911  template<typename _From, typename _To>
912  struct __is_base_to_derived_ref<_From, _To, true>
913  {
914  typedef typename remove_cv<typename remove_reference<_From
915  >::type>::type __src_t;
916  typedef typename remove_cv<typename remove_reference<_To
917  >::type>::type __dst_t;
918  typedef __and_<__not_<is_same<__src_t, __dst_t>>,
919  is_base_of<__src_t, __dst_t>> type;
920  static constexpr bool value = type::value;
921  };
922 
923  template<typename _From, typename _To>
924  struct __is_base_to_derived_ref<_From, _To, false>
925  : public false_type
926  { };
927 
928  template<typename _From, typename _To, bool
929  = __and_<is_lvalue_reference<_From>,
930  is_rvalue_reference<_To>>::value>
931  struct __is_lvalue_to_rvalue_ref;
932 
933  // Detect whether we have an lvalue of non-function type
934  // bound to a reference-compatible rvalue-reference.
935  template<typename _From, typename _To>
936  struct __is_lvalue_to_rvalue_ref<_From, _To, true>
937  {
938  typedef typename remove_cv<typename remove_reference<
939  _From>::type>::type __src_t;
940  typedef typename remove_cv<typename remove_reference<
941  _To>::type>::type __dst_t;
942  typedef __and_<__not_<is_function<__src_t>>,
943  __or_<is_same<__src_t, __dst_t>,
944  is_base_of<__dst_t, __src_t>>> type;
945  static constexpr bool value = type::value;
946  };
947 
948  template<typename _From, typename _To>
949  struct __is_lvalue_to_rvalue_ref<_From, _To, false>
950  : public false_type
951  { };
952 
953  // Here we handle direct-initialization to a reference type as
954  // equivalent to a static_cast modulo overshooting conversions.
955  // These are restricted to the following conversions:
956  // a) A base class value to a derived class reference
957  // b) An lvalue to an rvalue-reference of reference-compatible
958  // types that are not functions
959  template<typename _Tp, typename _Arg>
960  struct __is_direct_constructible_ref_cast
961  : public __and_<__is_static_castable<_Arg, _Tp>,
962  __not_<__or_<__is_base_to_derived_ref<_Arg, _Tp>,
963  __is_lvalue_to_rvalue_ref<_Arg, _Tp>
964  >>>::type
965  { };
966 
967  template<typename _Tp, typename _Arg>
968  struct __is_direct_constructible_new
969  : public conditional<is_reference<_Tp>::value,
970  __is_direct_constructible_ref_cast<_Tp, _Arg>,
971  __is_direct_constructible_new_safe<_Tp, _Arg>
972  >::type
973  { };
974 
975  template<typename _Tp, typename _Arg>
976  struct __is_direct_constructible
977  : public __is_direct_constructible_new<_Tp, _Arg>::type
978  { };
979 
980  // Since default-construction and binary direct-initialization have
981  // been handled separately, the implementation of the remaining
982  // n-ary construction cases is rather straightforward. We can use
983  // here a functional cast, because array types are excluded anyway
984  // and this form is never interpreted as a C cast.
985  struct __do_is_nary_constructible_impl
986  {
987  template<typename _Tp, typename... _Args, typename
988  = decltype(_Tp(declval<_Args>()...))>
989  static true_type __test(int);
990 
991  template<typename, typename...>
992  static false_type __test(...);
993  };
994 
995  template<typename _Tp, typename... _Args>
996  struct __is_nary_constructible_impl
997  : public __do_is_nary_constructible_impl
998  {
999  typedef decltype(__test<_Tp, _Args...>(0)) type;
1000  };
1001 
1002  template<typename _Tp, typename... _Args>
1003  struct __is_nary_constructible
1004  : public __is_nary_constructible_impl<_Tp, _Args...>::type
1005  {
1006  static_assert(sizeof...(_Args) > 1,
1007  "Only useful for > 1 arguments");
1008  };
1009 
1010  template<typename _Tp, typename... _Args>
1011  struct __is_constructible_impl
1012  : public __is_nary_constructible<_Tp, _Args...>
1013  { };
1014 
1015  template<typename _Tp, typename _Arg>
1016  struct __is_constructible_impl<_Tp, _Arg>
1017  : public __is_direct_constructible<_Tp, _Arg>
1018  { };
1019 
1020  template<typename _Tp>
1021  struct __is_constructible_impl<_Tp>
1022  : public is_default_constructible<_Tp>
1023  { };
1024 
1025  /// is_constructible
1026  template<typename _Tp, typename... _Args>
1027  struct is_constructible
1028  : public __is_constructible_impl<_Tp, _Args...>::type
1029  { };
1030 
1031  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1032  struct __is_copy_constructible_impl;
1033 
1034  template<typename _Tp>
1035  struct __is_copy_constructible_impl<_Tp, false>
1036  : public false_type { };
1037 
1038  template<typename _Tp>
1039  struct __is_copy_constructible_impl<_Tp, true>
1040  : public is_constructible<_Tp, const _Tp&>
1041  { };
1042 
1043  /// is_copy_constructible
1044  template<typename _Tp>
1045  struct is_copy_constructible
1046  : public __is_copy_constructible_impl<_Tp>
1047  { };
1048 
1049  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1050  struct __is_move_constructible_impl;
1051 
1052  template<typename _Tp>
1053  struct __is_move_constructible_impl<_Tp, false>
1054  : public false_type { };
1055 
1056  template<typename _Tp>
1057  struct __is_move_constructible_impl<_Tp, true>
1058  : public is_constructible<_Tp, _Tp&&>
1059  { };
1060 
1061  /// is_move_constructible
1062  template<typename _Tp>
1063  struct is_move_constructible
1064  : public __is_move_constructible_impl<_Tp>
1065  { };
1066 
1067  template<typename _Tp>
1068  struct __is_nt_default_constructible_atom
1069  : public integral_constant<bool, noexcept(_Tp())>
1070  { };
1071 
1072  template<typename _Tp, bool = is_array<_Tp>::value>
1073  struct __is_nt_default_constructible_impl;
1074 
1075  template<typename _Tp>
1076  struct __is_nt_default_constructible_impl<_Tp, true>
1077  : public __and_<__is_array_known_bounds<_Tp>,
1078  __is_nt_default_constructible_atom<typename
1079  remove_all_extents<_Tp>::type>>::type
1080  { };
1081 
1082  template<typename _Tp>
1083  struct __is_nt_default_constructible_impl<_Tp, false>
1084  : public __is_nt_default_constructible_atom<_Tp>
1085  { };
1086 
1087  /// is_nothrow_default_constructible
1088  template<typename _Tp>
1089  struct is_nothrow_default_constructible
1090  : public __and_<is_default_constructible<_Tp>,
1091  __is_nt_default_constructible_impl<_Tp>>::type
1092  { };
1093 
1094  template<typename _Tp, typename... _Args>
1095  struct __is_nt_constructible_impl
1096  : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
1097  { };
1098 
1099  template<typename _Tp, typename _Arg>
1100  struct __is_nt_constructible_impl<_Tp, _Arg>
1101  : public integral_constant<bool,
1102  noexcept(static_cast<_Tp>(declval<_Arg>()))>
1103  { };
1104 
1105  template<typename _Tp>
1106  struct __is_nt_constructible_impl<_Tp>
1107  : public is_nothrow_default_constructible<_Tp>
1108  { };
1109 
1110  /// is_nothrow_constructible
1111  template<typename _Tp, typename... _Args>
1112  struct is_nothrow_constructible
1113  : public __and_<is_constructible<_Tp, _Args...>,
1114  __is_nt_constructible_impl<_Tp, _Args...>>::type
1115  { };
1116 
1117  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1118  struct __is_nothrow_copy_constructible_impl;
1119 
1120  template<typename _Tp>
1121  struct __is_nothrow_copy_constructible_impl<_Tp, false>
1122  : public false_type { };
1123 
1124  template<typename _Tp>
1125  struct __is_nothrow_copy_constructible_impl<_Tp, true>
1126  : public is_nothrow_constructible<_Tp, const _Tp&>
1127  { };
1128 
1129  /// is_nothrow_copy_constructible
1130  template<typename _Tp>
1131  struct is_nothrow_copy_constructible
1132  : public __is_nothrow_copy_constructible_impl<_Tp>
1133  { };
1134 
1135  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1136  struct __is_nothrow_move_constructible_impl;
1137 
1138  template<typename _Tp>
1139  struct __is_nothrow_move_constructible_impl<_Tp, false>
1140  : public false_type { };
1141 
1142  template<typename _Tp>
1143  struct __is_nothrow_move_constructible_impl<_Tp, true>
1144  : public is_nothrow_constructible<_Tp, _Tp&&>
1145  { };
1146 
1147  /// is_nothrow_move_constructible
1148  template<typename _Tp>
1149  struct is_nothrow_move_constructible
1150  : public __is_nothrow_move_constructible_impl<_Tp>
1151  { };
1152 
1153  template<typename _Tp, typename _Up>
1154  class __is_assignable_helper
1155  {
1156  template<typename _Tp1, typename _Up1,
1157  typename = decltype(declval<_Tp1>() = declval<_Up1>())>
1158  static true_type
1159  __test(int);
1160 
1161  template<typename, typename>
1162  static false_type
1163  __test(...);
1164 
1165  public:
1166  typedef decltype(__test<_Tp, _Up>(0)) type;
1167  };
1168 
1169  /// is_assignable
1170  template<typename _Tp, typename _Up>
1171  struct is_assignable
1172  : public __is_assignable_helper<_Tp, _Up>::type
1173  { };
1174 
1175  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1176  struct __is_copy_assignable_impl;
1177 
1178  template<typename _Tp>
1179  struct __is_copy_assignable_impl<_Tp, false>
1180  : public false_type { };
1181 
1182  template<typename _Tp>
1183  struct __is_copy_assignable_impl<_Tp, true>
1184  : public is_assignable<_Tp&, const _Tp&>
1185  { };
1186 
1187  /// is_copy_assignable
1188  template<typename _Tp>
1189  struct is_copy_assignable
1190  : public __is_copy_assignable_impl<_Tp>
1191  { };
1192 
1193  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1194  struct __is_move_assignable_impl;
1195 
1196  template<typename _Tp>
1197  struct __is_move_assignable_impl<_Tp, false>
1198  : public false_type { };
1199 
1200  template<typename _Tp>
1201  struct __is_move_assignable_impl<_Tp, true>
1202  : public is_assignable<_Tp&, _Tp&&>
1203  { };
1204 
1205  /// is_move_assignable
1206  template<typename _Tp>
1207  struct is_move_assignable
1208  : public __is_move_assignable_impl<_Tp>
1209  { };
1210 
1211  template<typename _Tp, typename _Up>
1212  struct __is_nt_assignable_impl
1213  : public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Up>())>
1214  { };
1215 
1216  /// is_nothrow_assignable
1217  template<typename _Tp, typename _Up>
1218  struct is_nothrow_assignable
1219  : public __and_<is_assignable<_Tp, _Up>,
1220  __is_nt_assignable_impl<_Tp, _Up>>::type
1221  { };
1222 
1223  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1224  struct __is_nt_copy_assignable_impl;
1225 
1226  template<typename _Tp>
1227  struct __is_nt_copy_assignable_impl<_Tp, false>
1228  : public false_type { };
1229 
1230  template<typename _Tp>
1231  struct __is_nt_copy_assignable_impl<_Tp, true>
1232  : public is_nothrow_assignable<_Tp&, const _Tp&>
1233  { };
1234 
1235  /// is_nothrow_copy_assignable
1236  template<typename _Tp>
1237  struct is_nothrow_copy_assignable
1238  : public __is_nt_copy_assignable_impl<_Tp>
1239  { };
1240 
1241  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1242  struct __is_nt_move_assignable_impl;
1243 
1244  template<typename _Tp>
1245  struct __is_nt_move_assignable_impl<_Tp, false>
1246  : public false_type { };
1247 
1248  template<typename _Tp>
1249  struct __is_nt_move_assignable_impl<_Tp, true>
1250  : public is_nothrow_assignable<_Tp&, _Tp&&>
1251  { };
1252 
1253  /// is_nothrow_move_assignable
1254  template<typename _Tp>
1255  struct is_nothrow_move_assignable
1256  : public __is_nt_move_assignable_impl<_Tp>
1257  { };
1258 
1259  /// is_trivially_constructible (still unimplemented)
1260 
1261  /// is_trivially_default_constructible (still unimplemented)
1262 
1263  /// is_trivially_copy_constructible (still unimplemented)
1264 
1265  /// is_trivially_move_constructible (still unimplemented)
1266 
1267  /// is_trivially_assignable (still unimplemented)
1268 
1269  /// is_trivially_copy_assignable (still unimplemented)
1270 
1271  /// is_trivially_move_assignable (still unimplemented)
1272 
1273  /// is_trivially_destructible
1274  template<typename _Tp>
1275  struct is_trivially_destructible
1276  : public __and_<is_destructible<_Tp>, integral_constant<bool,
1277  __has_trivial_destructor(_Tp)>>::type
1278  { };
1279 
1280  /// has_trivial_default_constructor (temporary legacy)
1281  template<typename _Tp>
1282  struct has_trivial_default_constructor
1283  : public integral_constant<bool, __has_trivial_constructor(_Tp)>
1284  { };
1285 
1286  /// has_trivial_copy_constructor (temporary legacy)
1287  template<typename _Tp>
1288  struct has_trivial_copy_constructor
1289  : public integral_constant<bool, __has_trivial_copy(_Tp)>
1290  { };
1291 
1292  /// has_trivial_copy_assign (temporary legacy)
1293  template<typename _Tp>
1294  struct has_trivial_copy_assign
1295  : public integral_constant<bool, __has_trivial_assign(_Tp)>
1296  { };
1297 
1298  /// has_virtual_destructor
1299  template<typename _Tp>
1300  struct has_virtual_destructor
1301  : public integral_constant<bool, __has_virtual_destructor(_Tp)>
1302  { };
1303 
1304 
1305  // type property queries.
1306 
1307  /// alignment_of
1308  template<typename _Tp>
1309  struct alignment_of
1310  : public integral_constant<std::size_t, __alignof__(_Tp)> { };
1311 
1312  /// rank
1313  template<typename>
1314  struct rank
1315  : public integral_constant<std::size_t, 0> { };
1316 
1317  template<typename _Tp, std::size_t _Size>
1318  struct rank<_Tp[_Size]>
1319  : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1320 
1321  template<typename _Tp>
1322  struct rank<_Tp[]>
1323  : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1324 
1325  /// extent
1326  template<typename, unsigned _Uint>
1327  struct extent
1328  : public integral_constant<std::size_t, 0> { };
1329 
1330  template<typename _Tp, unsigned _Uint, std::size_t _Size>
1331  struct extent<_Tp[_Size], _Uint>
1332  : public integral_constant<std::size_t,
1333  _Uint == 0 ? _Size : extent<_Tp,
1334  _Uint - 1>::value>
1335  { };
1336 
1337  template<typename _Tp, unsigned _Uint>
1338  struct extent<_Tp[], _Uint>
1339  : public integral_constant<std::size_t,
1340  _Uint == 0 ? 0 : extent<_Tp,
1341  _Uint - 1>::value>
1342  { };
1343 
1344 
1345  // Type relations.
1346 
1347  /// is_same
1348  template<typename, typename>
1349  struct is_same
1350  : public false_type { };
1351 
1352  template<typename _Tp>
1353  struct is_same<_Tp, _Tp>
1354  : public true_type { };
1355 
1356  /// is_base_of
1357  template<typename _Base, typename _Derived>
1358  struct is_base_of
1359  : public integral_constant<bool, __is_base_of(_Base, _Derived)>
1360  { };
1361 
1362  template<typename _From, typename _To,
1363  bool = __or_<is_void<_From>, is_function<_To>,
1364  is_array<_To>>::value>
1365  struct __is_convertible_helper
1366  { typedef typename is_void<_To>::type type; };
1367 
1368  template<typename _From, typename _To>
1369  class __is_convertible_helper<_From, _To, false>
1370  {
1371  template<typename _To1>
1372  static void __test_aux(_To1);
1373 
1374  template<typename _From1, typename _To1,
1375  typename = decltype(__test_aux<_To1>(std::declval<_From1>()))>
1376  static true_type
1377  __test(int);
1378 
1379  template<typename, typename>
1380  static false_type
1381  __test(...);
1382 
1383  public:
1384  typedef decltype(__test<_From, _To>(0)) type;
1385  };
1386 
1387 
1388  /// is_convertible
1389  template<typename _From, typename _To>
1390  struct is_convertible
1391  : public __is_convertible_helper<_From, _To>::type
1392  { };
1393 
1394 
1395  // Const-volatile modifications.
1396 
1397  /// remove_const
1398  template<typename _Tp>
1399  struct remove_const
1400  { typedef _Tp type; };
1401 
1402  template<typename _Tp>
1403  struct remove_const<_Tp const>
1404  { typedef _Tp type; };
1405 
1406  /// remove_volatile
1407  template<typename _Tp>
1408  struct remove_volatile
1409  { typedef _Tp type; };
1410 
1411  template<typename _Tp>
1412  struct remove_volatile<_Tp volatile>
1413  { typedef _Tp type; };
1414 
1415  /// remove_cv
1416  template<typename _Tp>
1417  struct remove_cv
1418  {
1419  typedef typename
1420  remove_const<typename remove_volatile<_Tp>::type>::type type;
1421  };
1422 
1423  /// add_const
1424  template<typename _Tp>
1425  struct add_const
1426  { typedef _Tp const type; };
1427 
1428  /// add_volatile
1429  template<typename _Tp>
1430  struct add_volatile
1431  { typedef _Tp volatile type; };
1432 
1433  /// add_cv
1434  template<typename _Tp>
1435  struct add_cv
1436  {
1437  typedef typename
1438  add_const<typename add_volatile<_Tp>::type>::type type;
1439  };
1440 
1441 #if __cplusplus > 201103L
1442  /// Alias template for remove_const
1443  template<typename _Tp>
1444  using remove_const_t = typename remove_const<_Tp>::type;
1445 
1446  /// Alias template for remove_volatile
1447  template<typename _Tp>
1448  using remove_volatile_t = typename remove_volatile<_Tp>::type;
1449 
1450  /// Alias template for remove_cv
1451  template<typename _Tp>
1452  using remove_cv_t = typename remove_cv<_Tp>::type;
1453 
1454  /// Alias template for add_const
1455  template<typename _Tp>
1456  using add_const_t = typename add_const<_Tp>::type;
1457 
1458  /// Alias template for add_volatile
1459  template<typename _Tp>
1460  using add_volatile_t = typename add_volatile<_Tp>::type;
1461 
1462  /// Alias template for add_cv
1463  template<typename _Tp>
1464  using add_cv_t = typename add_cv<_Tp>::type;
1465 #endif
1466 
1467  // Reference transformations.
1468 
1469  /// remove_reference
1470  template<typename _Tp>
1471  struct remove_reference
1472  { typedef _Tp type; };
1473 
1474  template<typename _Tp>
1475  struct remove_reference<_Tp&>
1476  { typedef _Tp type; };
1477 
1478  template<typename _Tp>
1479  struct remove_reference<_Tp&&>
1480  { typedef _Tp type; };
1481 
1482  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1483  struct __add_lvalue_reference_helper
1484  { typedef _Tp type; };
1485 
1486  template<typename _Tp>
1487  struct __add_lvalue_reference_helper<_Tp, true>
1488  { typedef _Tp& type; };
1489 
1490  /// add_lvalue_reference
1491  template<typename _Tp>
1492  struct add_lvalue_reference
1493  : public __add_lvalue_reference_helper<_Tp>
1494  { };
1495 
1496  template<typename _Tp, bool = __is_referenceable<_Tp>::value>
1497  struct __add_rvalue_reference_helper
1498  { typedef _Tp type; };
1499 
1500  template<typename _Tp>
1501  struct __add_rvalue_reference_helper<_Tp, true>
1502  { typedef _Tp&& type; };
1503 
1504  /// add_rvalue_reference
1505  template<typename _Tp>
1506  struct add_rvalue_reference
1507  : public __add_rvalue_reference_helper<_Tp>
1508  { };
1509 
1510 #if __cplusplus > 201103L
1511  /// Alias template for remove_reference
1512  template<typename _Tp>
1513  using remove_reference_t = typename remove_reference<_Tp>::type;
1514 
1515  /// Alias template for add_lvalue_reference
1516  template<typename _Tp>
1517  using add_lvalue_reference_t = typename add_lvalue_reference<_Tp>::type;
1518 
1519  /// Alias template for add_rvalue_reference
1520  template<typename _Tp>
1521  using add_rvalue_reference_t = typename add_rvalue_reference<_Tp>::type;
1522 #endif
1523 
1524  // Sign modifications.
1525 
1526  // Utility for constructing identically cv-qualified types.
1527  template<typename _Unqualified, bool _IsConst, bool _IsVol>
1528  struct __cv_selector;
1529 
1530  template<typename _Unqualified>
1531  struct __cv_selector<_Unqualified, false, false>
1532  { typedef _Unqualified __type; };
1533 
1534  template<typename _Unqualified>
1535  struct __cv_selector<_Unqualified, false, true>
1536  { typedef volatile _Unqualified __type; };
1537 
1538  template<typename _Unqualified>
1539  struct __cv_selector<_Unqualified, true, false>
1540  { typedef const _Unqualified __type; };
1541 
1542  template<typename _Unqualified>
1543  struct __cv_selector<_Unqualified, true, true>
1544  { typedef const volatile _Unqualified __type; };
1545 
1546  template<typename _Qualified, typename _Unqualified,
1547  bool _IsConst = is_const<_Qualified>::value,
1548  bool _IsVol = is_volatile<_Qualified>::value>
1549  class __match_cv_qualifiers
1550  {
1551  typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1552 
1553  public:
1554  typedef typename __match::__type __type;
1555  };
1556 
1557  // Utility for finding the unsigned versions of signed integral types.
1558  template<typename _Tp>
1559  struct __make_unsigned
1560  { typedef _Tp __type; };
1561 
1562  template<>
1563  struct __make_unsigned<char>
1564  { typedef unsigned char __type; };
1565 
1566  template<>
1567  struct __make_unsigned<signed char>
1568  { typedef unsigned char __type; };
1569 
1570  template<>
1571  struct __make_unsigned<short>
1572  { typedef unsigned short __type; };
1573 
1574  template<>
1575  struct __make_unsigned<int>
1576  { typedef unsigned int __type; };
1577 
1578  template<>
1579  struct __make_unsigned<long>
1580  { typedef unsigned long __type; };
1581 
1582  template<>
1583  struct __make_unsigned<long long>
1584  { typedef unsigned long long __type; };
1585 
1586 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
1587  template<>
1588  struct __make_unsigned<__int128>
1589  { typedef unsigned __int128 __type; };
1590 #endif
1591 
1592  // Select between integral and enum: not possible to be both.
1593  template<typename _Tp,
1594  bool _IsInt = is_integral<_Tp>::value,
1595  bool _IsEnum = is_enum<_Tp>::value>
1596  class __make_unsigned_selector;
1597 
1598  template<typename _Tp>
1599  class __make_unsigned_selector<_Tp, true, false>
1600  {
1601  typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
1602  typedef typename __unsignedt::__type __unsigned_type;
1603  typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
1604 
1605  public:
1606  typedef typename __cv_unsigned::__type __type;
1607  };
1608 
1609  template<typename _Tp>
1610  class __make_unsigned_selector<_Tp, false, true>
1611  {
1612  // With -fshort-enums, an enum may be as small as a char.
1613  typedef unsigned char __smallest;
1614  static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
1615  static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned short);
1616  static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned int);
1617  typedef conditional<__b2, unsigned int, unsigned long> __cond2;
1618  typedef typename __cond2::type __cond2_type;
1619  typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
1620  typedef typename __cond1::type __cond1_type;
1621 
1622  public:
1623  typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
1624  };
1625 
1626  // Given an integral/enum type, return the corresponding unsigned
1627  // integer type.
1628  // Primary template.
1629  /// make_unsigned
1630  template<typename _Tp>
1631  struct make_unsigned
1632  { typedef typename __make_unsigned_selector<_Tp>::__type type; };
1633 
1634  // Integral, but don't define.
1635  template<>
1636  struct make_unsigned<bool>;
1637 
1638 
1639  // Utility for finding the signed versions of unsigned integral types.
1640  template<typename _Tp>
1641  struct __make_signed
1642  { typedef _Tp __type; };
1643 
1644  template<>
1645  struct __make_signed<char>
1646  { typedef signed char __type; };
1647 
1648  template<>
1649  struct __make_signed<unsigned char>
1650  { typedef signed char __type; };
1651 
1652  template<>
1653  struct __make_signed<unsigned short>
1654  { typedef signed short __type; };
1655 
1656  template<>
1657  struct __make_signed<unsigned int>
1658  { typedef signed int __type; };
1659 
1660  template<>
1661  struct __make_signed<unsigned long>
1662  { typedef signed long __type; };
1663 
1664  template<>
1665  struct __make_signed<unsigned long long>
1666  { typedef signed long long __type; };
1667 
1668 #if !defined(__STRICT_ANSI__) && defined(_GLIBCXX_USE_INT128)
1669  template<>
1670  struct __make_signed<unsigned __int128>
1671  { typedef __int128 __type; };
1672 #endif
1673 
1674  // Select between integral and enum: not possible to be both.
1675  template<typename _Tp,
1676  bool _IsInt = is_integral<_Tp>::value,
1677  bool _IsEnum = is_enum<_Tp>::value>
1678  class __make_signed_selector;
1679 
1680  template<typename _Tp>
1681  class __make_signed_selector<_Tp, true, false>
1682  {
1683  typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
1684  typedef typename __signedt::__type __signed_type;
1685  typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
1686 
1687  public:
1688  typedef typename __cv_signed::__type __type;
1689  };
1690 
1691  template<typename _Tp>
1692  class __make_signed_selector<_Tp, false, true>
1693  {
1694  // With -fshort-enums, an enum may be as small as a char.
1695  typedef signed char __smallest;
1696  static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
1697  static const bool __b1 = sizeof(_Tp) <= sizeof(signed short);
1698  static const bool __b2 = sizeof(_Tp) <= sizeof(signed int);
1699  typedef conditional<__b2, signed int, signed long> __cond2;
1700  typedef typename __cond2::type __cond2_type;
1701  typedef conditional<__b1, signed short, __cond2_type> __cond1;
1702  typedef typename __cond1::type __cond1_type;
1703 
1704  public:
1705  typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
1706  };
1707 
1708  // Given an integral/enum type, return the corresponding signed
1709  // integer type.
1710  // Primary template.
1711  /// make_signed
1712  template<typename _Tp>
1713  struct make_signed
1714  { typedef typename __make_signed_selector<_Tp>::__type type; };
1715 
1716  // Integral, but don't define.
1717  template<>
1718  struct make_signed<bool>;
1719 
1720 #if __cplusplus > 201103L
1721  /// Alias template for make_signed
1722  template<typename _Tp>
1723  using make_signed_t = typename make_signed<_Tp>::type;
1724 
1725  /// Alias template for make_unsigned
1726  template<typename _Tp>
1727  using make_unsigned_t = typename make_unsigned<_Tp>::type;
1728 #endif
1729 
1730  // Array modifications.
1731 
1732  /// remove_extent
1733  template<typename _Tp>
1734  struct remove_extent
1735  { typedef _Tp type; };
1736 
1737  template<typename _Tp, std::size_t _Size>
1738  struct remove_extent<_Tp[_Size]>
1739  { typedef _Tp type; };
1740 
1741  template<typename _Tp>
1742  struct remove_extent<_Tp[]>
1743  { typedef _Tp type; };
1744 
1745  /// remove_all_extents
1746  template<typename _Tp>
1747  struct remove_all_extents
1748  { typedef _Tp type; };
1749 
1750  template<typename _Tp, std::size_t _Size>
1751  struct remove_all_extents<_Tp[_Size]>
1752  { typedef typename remove_all_extents<_Tp>::type type; };
1753 
1754  template<typename _Tp>
1755  struct remove_all_extents<_Tp[]>
1756  { typedef typename remove_all_extents<_Tp>::type type; };
1757 
1758 #if __cplusplus > 201103L
1759  /// Alias template for remove_extent
1760  template<typename _Tp>
1761  using remove_extent_t = typename remove_extent<_Tp>::type;
1762 
1763  /// Alias template for remove_all_extents
1764  template<typename _Tp>
1765  using remove_all_extents_t = typename remove_all_extents<_Tp>::type;
1766 #endif
1767 
1768  // Pointer modifications.
1769 
1770  template<typename _Tp, typename>
1771  struct __remove_pointer_helper
1772  { typedef _Tp type; };
1773 
1774  template<typename _Tp, typename _Up>
1775  struct __remove_pointer_helper<_Tp, _Up*>
1776  { typedef _Up type; };
1777 
1778  /// remove_pointer
1779  template<typename _Tp>
1780  struct remove_pointer
1781  : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
1782  { };
1783 
1784  /// add_pointer
1785  template<typename _Tp, bool = __or_<__is_referenceable<_Tp>,
1786  is_void<_Tp>>::value>
1787  struct __add_pointer_helper
1788  { typedef _Tp type; };
1789 
1790  template<typename _Tp>
1791  struct __add_pointer_helper<_Tp, true>
1792  { typedef typename remove_reference<_Tp>::type* type; };
1793 
1794  template<typename _Tp>
1795  struct add_pointer
1796  : public __add_pointer_helper<_Tp>
1797  { };
1798 
1799 #if __cplusplus > 201103L
1800  /// Alias template for remove_pointer
1801  template<typename _Tp>
1802  using remove_pointer_t = typename remove_pointer<_Tp>::type;
1803 
1804  /// Alias template for add_pointer
1805  template<typename _Tp>
1806  using add_pointer_t = typename add_pointer<_Tp>::type;
1807 #endif
1808 
1809  template<std::size_t _Len>
1810  struct __aligned_storage_msa
1811  {
1812  union __type
1813  {
1814  unsigned char __data[_Len];
1815  struct __attribute__((__aligned__)) { } __align;
1816  };
1817  };
1818 
1819  /**
1820  * @brief Alignment type.
1821  *
1822  * The value of _Align is a default-alignment which shall be the
1823  * most stringent alignment requirement for any C++ object type
1824  * whose size is no greater than _Len (3.9). The member typedef
1825  * type shall be a POD type suitable for use as uninitialized
1826  * storage for any object whose size is at most _Len and whose
1827  * alignment is a divisor of _Align.
1828  */
1829  template<std::size_t _Len, std::size_t _Align =
1830  __alignof__(typename __aligned_storage_msa<_Len>::__type)>
1831  struct aligned_storage
1832  {
1833  union type
1834  {
1835  unsigned char __data[_Len];
1836  struct __attribute__((__aligned__((_Align)))) { } __align;
1837  };
1838  };
1839 
1840 
1841  // Decay trait for arrays and functions, used for perfect forwarding
1842  // in make_pair, make_tuple, etc.
1843  template<typename _Up,
1844  bool _IsArray = is_array<_Up>::value,
1845  bool _IsFunction = is_function<_Up>::value>
1846  struct __decay_selector;
1847 
1848  // NB: DR 705.
1849  template<typename _Up>
1850  struct __decay_selector<_Up, false, false>
1851  { typedef typename remove_cv<_Up>::type __type; };
1852 
1853  template<typename _Up>
1854  struct __decay_selector<_Up, true, false>
1855  { typedef typename remove_extent<_Up>::type* __type; };
1856 
1857  template<typename _Up>
1858  struct __decay_selector<_Up, false, true>
1859  { typedef typename add_pointer<_Up>::type __type; };
1860 
1861  /// decay
1862  template<typename _Tp>
1863  class decay
1864  {
1865  typedef typename remove_reference<_Tp>::type __remove_type;
1866 
1867  public:
1868  typedef typename __decay_selector<__remove_type>::__type type;
1869  };
1870 
1871  template<typename _Tp>
1872  class reference_wrapper;
1873 
1874  // Helper which adds a reference to a type when given a reference_wrapper
1875  template<typename _Tp>
1876  struct __strip_reference_wrapper
1877  {
1878  typedef _Tp __type;
1879  };
1880 
1881  template<typename _Tp>
1882  struct __strip_reference_wrapper<reference_wrapper<_Tp> >
1883  {
1884  typedef _Tp& __type;
1885  };
1886 
1887  template<typename _Tp>
1888  struct __decay_and_strip
1889  {
1890  typedef typename __strip_reference_wrapper<
1891  typename decay<_Tp>::type>::__type __type;
1892  };
1893 
1894 
1895  // Primary template.
1896  /// Define a member typedef @c type only if a boolean constant is true.
1897  template<bool, typename _Tp = void>
1898  struct enable_if
1899  { };
1900 
1901  // Partial specialization for true.
1902  template<typename _Tp>
1903  struct enable_if<true, _Tp>
1904  { typedef _Tp type; };
1905 
1906  template<typename... _Cond>
1907  using _Require = typename enable_if<__and_<_Cond...>::value>::type;
1908 
1909  // Primary template.
1910  /// Define a member typedef @c type to one of two argument types.
1911  template<bool _Cond, typename _Iftrue, typename _Iffalse>
1912  struct conditional
1913  { typedef _Iftrue type; };
1914 
1915  // Partial specialization for false.
1916  template<typename _Iftrue, typename _Iffalse>
1917  struct conditional<false, _Iftrue, _Iffalse>
1918  { typedef _Iffalse type; };
1919 
1920  /// common_type
1921  template<typename... _Tp>
1922  struct common_type;
1923 
1924  // Sfinae-friendly common_type implementation:
1925 
1926  struct __do_common_type_impl
1927  {
1928  template<typename _Tp, typename _Up>
1929  static __success_type<typename decay<decltype
1930  (true ? std::declval<_Tp>()
1931  : std::declval<_Up>())>::type> _S_test(int);
1932 
1933  template<typename, typename>
1934  static __failure_type _S_test(...);
1935  };
1936 
1937  template<typename _Tp, typename _Up>
1938  struct __common_type_impl
1939  : private __do_common_type_impl
1940  {
1941  typedef decltype(_S_test<_Tp, _Up>(0)) type;
1942  };
1943 
1944  struct __do_member_type_wrapper
1945  {
1946  template<typename _Tp>
1947  static __success_type<typename _Tp::type> _S_test(int);
1948 
1949  template<typename>
1950  static __failure_type _S_test(...);
1951  };
1952 
1953  template<typename _Tp>
1954  struct __member_type_wrapper
1955  : private __do_member_type_wrapper
1956  {
1957  typedef decltype(_S_test<_Tp>(0)) type;
1958  };
1959 
1960  template<typename _CTp, typename... _Args>
1961  struct __expanded_common_type_wrapper
1962  {
1963  typedef common_type<typename _CTp::type, _Args...> type;
1964  };
1965 
1966  template<typename... _Args>
1967  struct __expanded_common_type_wrapper<__failure_type, _Args...>
1968  { typedef __failure_type type; };
1969 
1970  template<typename _Tp>
1971  struct common_type<_Tp>
1972  { typedef typename decay<_Tp>::type type; };
1973 
1974  template<typename _Tp, typename _Up>
1975  struct common_type<_Tp, _Up>
1976  : public __common_type_impl<_Tp, _Up>::type
1977  { };
1978 
1979  template<typename _Tp, typename _Up, typename... _Vp>
1980  struct common_type<_Tp, _Up, _Vp...>
1981  : public __expanded_common_type_wrapper<typename __member_type_wrapper<
1982  common_type<_Tp, _Up>>::type, _Vp...>::type
1983  { };
1984 
1985  /// The underlying type of an enum.
1986  template<typename _Tp>
1987  struct underlying_type
1988  {
1989  typedef __underlying_type(_Tp) type;
1990  };
1991 
1992  template<typename _Tp>
1993  struct __declval_protector
1994  {
1995  static const bool __stop = false;
1996  static typename add_rvalue_reference<_Tp>::type __delegate();
1997  };
1998 
1999  template<typename _Tp>
2000  inline typename add_rvalue_reference<_Tp>::type
2001  declval() noexcept
2002  {
2003  static_assert(__declval_protector<_Tp>::__stop,
2004  "declval() must not be used!");
2005  return __declval_protector<_Tp>::__delegate();
2006  }
2007 
2008  /// result_of
2009  template<typename _Signature>
2010  class result_of;
2011 
2012  // Sfinae-friendly result_of implementation:
2013 
2014  // [func.require] paragraph 1 bullet 1:
2015  struct __result_of_memfun_ref_impl
2016  {
2017  template<typename _Fp, typename _Tp1, typename... _Args>
2018  static __success_type<decltype(
2019  (std::declval<_Tp1>().*std::declval<_Fp>())(std::declval<_Args>()...)
2020  )> _S_test(int);
2021 
2022  template<typename...>
2023  static __failure_type _S_test(...);
2024  };
2025 
2026  template<typename _MemPtr, typename _Arg, typename... _Args>
2027  struct __result_of_memfun_ref
2028  : private __result_of_memfun_ref_impl
2029  {
2030  typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2031  };
2032 
2033  // [func.require] paragraph 1 bullet 2:
2034  struct __result_of_memfun_deref_impl
2035  {
2036  template<typename _Fp, typename _Tp1, typename... _Args>
2037  static __success_type<decltype(
2038  ((*std::declval<_Tp1>()).*std::declval<_Fp>())(std::declval<_Args>()...)
2039  )> _S_test(int);
2040 
2041  template<typename...>
2042  static __failure_type _S_test(...);
2043  };
2044 
2045  template<typename _MemPtr, typename _Arg, typename... _Args>
2046  struct __result_of_memfun_deref
2047  : private __result_of_memfun_deref_impl
2048  {
2049  typedef decltype(_S_test<_MemPtr, _Arg, _Args...>(0)) type;
2050  };
2051 
2052  // [func.require] paragraph 1 bullet 3:
2053  struct __result_of_memobj_ref_impl
2054  {
2055  template<typename _Fp, typename _Tp1>
2056  static __success_type<decltype(
2057  std::declval<_Tp1>().*std::declval<_Fp>()
2058  )> _S_test(int);
2059 
2060  template<typename, typename>
2061  static __failure_type _S_test(...);
2062  };
2063 
2064  template<typename _MemPtr, typename _Arg>
2065  struct __result_of_memobj_ref
2066  : private __result_of_memobj_ref_impl
2067  {
2068  typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2069  };
2070 
2071  // [func.require] paragraph 1 bullet 4:
2072  struct __result_of_memobj_deref_impl
2073  {
2074  template<typename _Fp, typename _Tp1>
2075  static __success_type<decltype(
2076  (*std::declval<_Tp1>()).*std::declval<_Fp>()
2077  )> _S_test(int);
2078 
2079  template<typename, typename>
2080  static __failure_type _S_test(...);
2081  };
2082 
2083  template<typename _MemPtr, typename _Arg>
2084  struct __result_of_memobj_deref
2085  : private __result_of_memobj_deref_impl
2086  {
2087  typedef decltype(_S_test<_MemPtr, _Arg>(0)) type;
2088  };
2089 
2090  template<typename _MemPtr, typename _Arg>
2091  struct __result_of_memobj;
2092 
2093  template<typename _Res, typename _Class, typename _Arg>
2094  struct __result_of_memobj<_Res _Class::*, _Arg>
2095  {
2096  typedef typename remove_cv<typename remove_reference<
2097  _Arg>::type>::type _Argval;
2098  typedef _Res _Class::* _MemPtr;
2099  typedef typename conditional<__or_<is_same<_Argval, _Class>,
2100  is_base_of<_Class, _Argval>>::value,
2101  __result_of_memobj_ref<_MemPtr, _Arg>,
2102  __result_of_memobj_deref<_MemPtr, _Arg>
2103  >::type::type type;
2104  };
2105 
2106  template<typename _MemPtr, typename _Arg, typename... _Args>
2107  struct __result_of_memfun;
2108 
2109  template<typename _Res, typename _Class, typename _Arg, typename... _Args>
2110  struct __result_of_memfun<_Res _Class::*, _Arg, _Args...>
2111  {
2112  typedef typename remove_cv<typename remove_reference<
2113  _Arg>::type>::type _Argval;
2114  typedef _Res _Class::* _MemPtr;
2115  typedef typename conditional<__or_<is_same<_Argval, _Class>,
2116  is_base_of<_Class, _Argval>>::value,
2117  __result_of_memfun_ref<_MemPtr, _Arg, _Args...>,
2118  __result_of_memfun_deref<_MemPtr, _Arg, _Args...>
2119  >::type::type type;
2120  };
2121 
2122  template<bool, bool, typename _Functor, typename... _ArgTypes>
2123  struct __result_of_impl
2124  {
2125  typedef __failure_type type;
2126  };
2127 
2128  template<typename _MemPtr, typename _Arg>
2129  struct __result_of_impl<true, false, _MemPtr, _Arg>
2130  : public __result_of_memobj<typename decay<_MemPtr>::type, _Arg>
2131  { };
2132 
2133  template<typename _MemPtr, typename _Arg, typename... _Args>
2134  struct __result_of_impl<false, true, _MemPtr, _Arg, _Args...>
2135  : public __result_of_memfun<typename decay<_MemPtr>::type, _Arg, _Args...>
2136  { };
2137 
2138  // [func.require] paragraph 1 bullet 5:
2139  struct __result_of_other_impl
2140  {
2141  template<typename _Fn, typename... _Args>
2142  static __success_type<decltype(
2143  std::declval<_Fn>()(std::declval<_Args>()...)
2144  )> _S_test(int);
2145 
2146  template<typename...>
2147  static __failure_type _S_test(...);
2148  };
2149 
2150  template<typename _Functor, typename... _ArgTypes>
2151  struct __result_of_impl<false, false, _Functor, _ArgTypes...>
2152  : private __result_of_other_impl
2153  {
2154  typedef decltype(_S_test<_Functor, _ArgTypes...>(0)) type;
2155  };
2156 
2157  template<typename _Functor, typename... _ArgTypes>
2158  struct result_of<_Functor(_ArgTypes...)>
2159  : public __result_of_impl<
2160  is_member_object_pointer<
2161  typename remove_reference<_Functor>::type
2162  >::value,
2163  is_member_function_pointer<
2164  typename remove_reference<_Functor>::type
2165  >::value,
2166  _Functor, _ArgTypes...
2167  >::type
2168  { };
2169 
2170 #if __cplusplus > 201103L
2171  /// Alias template for aligned_storage
2172  template<size_t _Len, size_t _Align =
2173  __alignof__(typename __aligned_storage_msa<_Len>::__type)>
2174  using aligned_storage_t = typename aligned_storage<_Len, _Align>::type;
2175 
2176  /// Alias template for decay
2177  template<typename _Tp>
2178  using decay_t = typename decay<_Tp>::type;
2179 
2180  /// Alias template for enable_if
2181  template<bool _Cond, typename _Tp = void>
2182  using enable_if_t = typename enable_if<_Cond, _Tp>::type;
2183 
2184  /// Alias template for conditional
2185  template<bool _Cond, typename _Iftrue, typename _Iffalse>
2186  using conditional_t = typename conditional<_Cond, _Iftrue, _Iffalse>::type;
2187 
2188  /// Alias template for common_type
2189  template<typename... _Tp>
2190  using common_type_t = typename common_type<_Tp...>::type;
2191 
2192  /// Alias template for underlying_type
2193  template<typename _Tp>
2194  using underlying_type_t = typename underlying_type<_Tp>::type;
2195 
2196  /// Alias template for result_of
2197  template<typename _Tp>
2198  using result_of_t = typename result_of<_Tp>::type;
2199 #endif
2200 
2201  /// @} group metaprogramming
2202 
2203  /**
2204  * Use SFINAE to determine if the type _Tp has a publicly-accessible
2205  * member type _NTYPE.
2206  */
2207 #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
2208  template<typename _Tp> \
2209  class __has_##_NTYPE##_helper \
2210  { \
2211  template<typename _Up> \
2212  struct _Wrap_type \
2213  { }; \
2214  \
2215  template<typename _Up> \
2216  static true_type __test(_Wrap_type<typename _Up::_NTYPE>*); \
2217  \
2218  template<typename _Up> \
2219  static false_type __test(...); \
2220  \
2221  public: \
2222  typedef decltype(__test<_Tp>(0)) type; \
2223  }; \
2224  \
2225  template<typename _Tp> \
2226  struct __has_##_NTYPE \
2227  : public __has_##_NTYPE##_helper \
2228  <typename remove_cv<_Tp>::type>::type \
2229  { };
2230 
2231 _GLIBCXX_END_NAMESPACE_VERSION
2232 } // namespace std
2233 
2234 #endif // C++11
2235 
2236 #endif // _GLIBCXX_TYPE_TRAITS
is_void
Definition: type_traits:160
is_member_pointer
Definition: type_traits:521
is_array
Definition: type_traits:276
is_member_function_pointer
Definition: type_traits:347
is_scalar
Definition: type_traits:525
is_reference
Definition: type_traits:495
is_floating_point
Definition: type_traits:270
is_integral
Definition: type_traits:242
is_compound
Definition: type_traits:532
is_arithmetic
Definition: type_traits:502
is_enum
Definition: type_traits:354
is_union
Definition: type_traits:360
is_pointer
Definition: type_traits:297
is_fundamental
Definition: type_traits:508
is_lvalue_reference
Definition: type_traits:303
is_object
Definition: type_traits:515
is_polymorphic
Definition: type_traits:621
integral_constant
Definition: type_traits:57
is_empty
Definition: type_traits:615
is_trivial
Definition: type_traits:588
__is_nullptr_t (extension).
Definition: type_traits:487
is_class
Definition: type_traits:366
is_abstract
Definition: type_traits:627
integral_constant< bool, true > true_type
The type used as a compile-time boolean with true value.
Definition: type_traits:72
is_pod
Definition: type_traits:603
is_function
Definition: type_traits:320
is_volatile
Definition: type_traits:579
is_literal_type
Definition: type_traits:609
is_null_pointer (LWG 2247).
Definition: type_traits:481
integral_constant< bool, false > false_type
The type used as a compile-time boolean with false value.
Definition: type_traits:75
is_member_object_pointer
Definition: type_traits:332
is_const
Definition: type_traits:570
is_standard_layout
Definition: type_traits:596
is_rvalue_reference
Definition: type_traits:312