1 // C++0x type_traits -*- C++ -*-
3 // Copyright (C) 2007, 2008, 2009, 2010, 2011 Free Software Foundation, Inc.
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)
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.
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.
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/>.
25 /** @file include/type_traits
26 * This is a Standard C++ Library header.
29 #ifndef _GLIBCXX_TYPE_TRAITS
30 #define _GLIBCXX_TYPE_TRAITS 1
32 #pragma GCC system_header
34 #ifndef __GXX_EXPERIMENTAL_CXX0X__
35 # include <bits/c++0x_warning.h>
38 #include <bits/c++config.h>
40 namespace std _GLIBCXX_VISIBILITY(default)
42 _GLIBCXX_BEGIN_NAMESPACE_VERSION
45 * @addtogroup metaprogramming
50 template<typename _Tp, _Tp __v>
51 struct integral_constant
53 static constexpr _Tp value = __v;
54 typedef _Tp value_type;
55 typedef integral_constant<_Tp, __v> type;
56 constexpr operator value_type() { return value; }
59 /// typedef for true_type
60 typedef integral_constant<bool, true> true_type;
62 /// typedef for false_type
63 typedef integral_constant<bool, false> false_type;
65 template<typename _Tp, _Tp __v>
66 constexpr _Tp integral_constant<_Tp, __v>::value;
68 // Meta programming helper types.
70 template<bool, typename, typename>
81 template<typename _B1>
86 template<typename _B1, typename _B2>
87 struct __or_<_B1, _B2>
88 : public conditional<_B1::value, _B1, _B2>::type
91 template<typename _B1, typename _B2, typename _B3, typename... _Bn>
92 struct __or_<_B1, _B2, _B3, _Bn...>
93 : public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
104 template<typename _B1>
109 template<typename _B1, typename _B2>
110 struct __and_<_B1, _B2>
111 : public conditional<_B1::value, _B2, _B1>::type
114 template<typename _B1, typename _B2, typename _B3, typename... _Bn>
115 struct __and_<_B1, _B2, _B3, _Bn...>
116 : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
119 template<typename _Pp>
121 : public integral_constant<bool, !_Pp::value>
124 struct __sfinae_types
127 typedef struct { char __arr[2]; } __two;
130 // primary type categories.
136 struct __is_void_helper
137 : public false_type { };
140 struct __is_void_helper<void>
141 : public true_type { };
144 template<typename _Tp>
146 : public integral_constant<bool, (__is_void_helper<typename
147 remove_cv<_Tp>::type>::value)>
151 struct __is_integral_helper
152 : public false_type { };
155 struct __is_integral_helper<bool>
156 : public true_type { };
159 struct __is_integral_helper<char>
160 : public true_type { };
163 struct __is_integral_helper<signed char>
164 : public true_type { };
167 struct __is_integral_helper<unsigned char>
168 : public true_type { };
170 #ifdef _GLIBCXX_USE_WCHAR_T
172 struct __is_integral_helper<wchar_t>
173 : public true_type { };
177 struct __is_integral_helper<char16_t>
178 : public true_type { };
181 struct __is_integral_helper<char32_t>
182 : public true_type { };
185 struct __is_integral_helper<short>
186 : public true_type { };
189 struct __is_integral_helper<unsigned short>
190 : public true_type { };
193 struct __is_integral_helper<int>
194 : public true_type { };
197 struct __is_integral_helper<unsigned int>
198 : public true_type { };
201 struct __is_integral_helper<long>
202 : public true_type { };
205 struct __is_integral_helper<unsigned long>
206 : public true_type { };
209 struct __is_integral_helper<long long>
210 : public true_type { };
213 struct __is_integral_helper<unsigned long long>
214 : public true_type { };
217 template<typename _Tp>
219 : public integral_constant<bool, (__is_integral_helper<typename
220 remove_cv<_Tp>::type>::value)>
224 struct __is_floating_point_helper
225 : public false_type { };
228 struct __is_floating_point_helper<float>
229 : public true_type { };
232 struct __is_floating_point_helper<double>
233 : public true_type { };
236 struct __is_floating_point_helper<long double>
237 : public true_type { };
239 /// is_floating_point
240 template<typename _Tp>
241 struct is_floating_point
242 : public integral_constant<bool, (__is_floating_point_helper<typename
243 remove_cv<_Tp>::type>::value)>
249 : public false_type { };
251 template<typename _Tp, std::size_t _Size>
252 struct is_array<_Tp[_Size]>
253 : public true_type { };
255 template<typename _Tp>
256 struct is_array<_Tp[]>
257 : public true_type { };
260 struct __is_pointer_helper
261 : public false_type { };
263 template<typename _Tp>
264 struct __is_pointer_helper<_Tp*>
265 : public true_type { };
268 template<typename _Tp>
270 : public integral_constant<bool, (__is_pointer_helper<typename
271 remove_cv<_Tp>::type>::value)>
274 /// is_lvalue_reference
276 struct is_lvalue_reference
277 : public false_type { };
279 template<typename _Tp>
280 struct is_lvalue_reference<_Tp&>
281 : public true_type { };
283 /// is_rvalue_reference
285 struct is_rvalue_reference
286 : public false_type { };
288 template<typename _Tp>
289 struct is_rvalue_reference<_Tp&&>
290 : public true_type { };
296 struct __is_member_object_pointer_helper
297 : public false_type { };
299 template<typename _Tp, typename _Cp>
300 struct __is_member_object_pointer_helper<_Tp _Cp::*>
301 : public integral_constant<bool, !is_function<_Tp>::value> { };
303 /// is_member_object_pointer
304 template<typename _Tp>
305 struct is_member_object_pointer
306 : public integral_constant<bool, (__is_member_object_pointer_helper<
307 typename remove_cv<_Tp>::type>::value)>
311 struct __is_member_function_pointer_helper
312 : public false_type { };
314 template<typename _Tp, typename _Cp>
315 struct __is_member_function_pointer_helper<_Tp _Cp::*>
316 : public integral_constant<bool, is_function<_Tp>::value> { };
318 /// is_member_function_pointer
319 template<typename _Tp>
320 struct is_member_function_pointer
321 : public integral_constant<bool, (__is_member_function_pointer_helper<
322 typename remove_cv<_Tp>::type>::value)>
326 template<typename _Tp>
328 : public integral_constant<bool, __is_enum(_Tp)>
332 template<typename _Tp>
334 : public integral_constant<bool, __is_union(_Tp)>
338 template<typename _Tp>
340 : public integral_constant<bool, __is_class(_Tp)>
346 : public false_type { };
348 template<typename _Res, typename... _ArgTypes>
349 struct is_function<_Res(_ArgTypes...)>
350 : public true_type { };
352 template<typename _Res, typename... _ArgTypes>
353 struct is_function<_Res(_ArgTypes......)>
354 : public true_type { };
356 template<typename _Res, typename... _ArgTypes>
357 struct is_function<_Res(_ArgTypes...) const>
358 : public true_type { };
360 template<typename _Res, typename... _ArgTypes>
361 struct is_function<_Res(_ArgTypes......) const>
362 : public true_type { };
364 template<typename _Res, typename... _ArgTypes>
365 struct is_function<_Res(_ArgTypes...) volatile>
366 : public true_type { };
368 template<typename _Res, typename... _ArgTypes>
369 struct is_function<_Res(_ArgTypes......) volatile>
370 : public true_type { };
372 template<typename _Res, typename... _ArgTypes>
373 struct is_function<_Res(_ArgTypes...) const volatile>
374 : public true_type { };
376 template<typename _Res, typename... _ArgTypes>
377 struct is_function<_Res(_ArgTypes......) const volatile>
378 : public true_type { };
381 struct __is_nullptr_t_helper
382 : public false_type { };
385 struct __is_nullptr_t_helper<std::nullptr_t>
386 : public true_type { };
388 // __is_nullptr_t (extension).
389 template<typename _Tp>
390 struct __is_nullptr_t
391 : public integral_constant<bool, (__is_nullptr_t_helper<typename
392 remove_cv<_Tp>::type>::value)>
395 // composite type categories.
398 template<typename _Tp>
400 : public __or_<is_lvalue_reference<_Tp>,
401 is_rvalue_reference<_Tp>>::type
405 template<typename _Tp>
407 : public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
411 template<typename _Tp>
412 struct is_fundamental
413 : public __or_<is_arithmetic<_Tp>, is_void<_Tp>>::type
417 template<typename _Tp>
419 : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
424 struct is_member_pointer;
427 template<typename _Tp>
429 : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
430 is_member_pointer<_Tp>, __is_nullptr_t<_Tp>>::type
434 template<typename _Tp>
436 : public integral_constant<bool, !is_fundamental<_Tp>::value> { };
438 /// is_member_pointer
439 template<typename _Tp>
440 struct __is_member_pointer_helper
441 : public false_type { };
443 template<typename _Tp, typename _Cp>
444 struct __is_member_pointer_helper<_Tp _Cp::*>
445 : public true_type { };
447 template<typename _Tp>
448 struct is_member_pointer
449 : public integral_constant<bool, (__is_member_pointer_helper<
450 typename remove_cv<_Tp>::type>::value)>
458 : public false_type { };
460 template<typename _Tp>
461 struct is_const<_Tp const>
462 : public true_type { };
467 : public false_type { };
469 template<typename _Tp>
470 struct is_volatile<_Tp volatile>
471 : public true_type { };
474 template<typename _Tp>
476 : public integral_constant<bool, __is_trivial(_Tp)>
479 /// is_trivially_copyable (still unimplemented)
481 /// is_standard_layout
482 template<typename _Tp>
483 struct is_standard_layout
484 : public integral_constant<bool, __is_standard_layout(_Tp)>
488 // Could use is_standard_layout && is_trivial instead of the builtin.
489 template<typename _Tp>
491 : public integral_constant<bool, __is_pod(_Tp)>
495 template<typename _Tp>
496 struct is_literal_type
497 : public integral_constant<bool, __is_literal_type(_Tp)>
501 template<typename _Tp>
503 : public integral_constant<bool, __is_empty(_Tp)>
507 template<typename _Tp>
508 struct is_polymorphic
509 : public integral_constant<bool, __is_polymorphic(_Tp)>
513 template<typename _Tp>
515 : public integral_constant<bool, __is_abstract(_Tp)>
518 template<typename _Tp,
519 bool = is_integral<_Tp>::value,
520 bool = is_floating_point<_Tp>::value>
521 struct __is_signed_helper
522 : public false_type { };
524 template<typename _Tp>
525 struct __is_signed_helper<_Tp, false, true>
526 : public true_type { };
528 template<typename _Tp>
529 struct __is_signed_helper<_Tp, true, false>
530 : public integral_constant<bool, static_cast<bool>(_Tp(-1) < _Tp(0))>
534 template<typename _Tp>
536 : public integral_constant<bool, __is_signed_helper<_Tp>::value>
540 template<typename _Tp>
542 : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
546 // destructible and constructible type properties
549 struct add_rvalue_reference;
551 template<typename _Tp>
552 typename add_rvalue_reference<_Tp>::type declval() noexcept;
554 template<typename, unsigned = 0>
558 struct remove_all_extents;
560 template<typename _Tp>
561 struct __is_array_known_bounds
562 : public integral_constant<bool, (extent<_Tp>::value > 0)>
565 template<typename _Tp>
566 struct __is_array_unknown_bounds
567 : public __and_<is_array<_Tp>, __not_<extent<_Tp>>>::type
570 // In N3290 is_destructible does not say anything about function
571 // types and abstract types, see LWG 2049. This implementation
572 // describes function types as trivially nothrow destructible and
573 // abstract types as destructible, iff the explicit destructor
574 // call expression is wellformed.
575 struct __do_is_destructible_impl_1
577 template<typename _Up>
578 struct __w { _Up __u; };
580 template<typename _Tp, typename
581 = decltype(declval<__w<_Tp>&>().~__w<_Tp>())>
582 static true_type __test(int);
585 static false_type __test(...);
588 template<typename _Tp>
589 struct __is_destructible_impl_1
590 : public __do_is_destructible_impl_1
592 typedef decltype(__test<_Tp>(0)) type;
595 // Special implementation for abstract types
596 struct __do_is_destructible_impl_2
598 template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
599 static true_type __test(int);
602 static false_type __test(...);
605 template<typename _Tp>
606 struct __is_destructible_impl_2
607 : public __do_is_destructible_impl_2
609 typedef decltype(__test<_Tp>(0)) type;
612 template<typename _Tp,
613 bool = __or_<is_void<_Tp>,
614 __is_array_unknown_bounds<_Tp>>::value,
615 bool = __or_<is_reference<_Tp>, is_function<_Tp>>::value>
616 struct __is_destructible_safe;
618 template<typename _Tp>
619 struct __is_destructible_safe<_Tp, false, false>
620 : public conditional<is_abstract<_Tp>::value,
621 __is_destructible_impl_2<_Tp>,
622 __is_destructible_impl_1<_Tp>>::type::type
625 template<typename _Tp>
626 struct __is_destructible_safe<_Tp, true, false>
627 : public false_type { };
629 template<typename _Tp>
630 struct __is_destructible_safe<_Tp, false, true>
631 : public true_type { };
634 template<typename _Tp>
635 struct is_destructible
636 : public integral_constant<bool, (__is_destructible_safe<_Tp>::value)>
639 struct __do_is_default_constructible_impl
641 template<typename _Tp, typename = decltype(_Tp())>
642 static true_type __test(int);
645 static false_type __test(...);
648 template<typename _Tp>
649 struct __is_default_constructible_impl
650 : public __do_is_default_constructible_impl
652 typedef decltype(__test<_Tp>(0)) type;
655 template<typename _Tp>
656 struct __is_default_constructible_atom
657 : public __and_<__not_<is_void<_Tp>>,
658 __is_default_constructible_impl<_Tp>>::type
661 template<typename _Tp, bool = is_array<_Tp>::value>
662 struct __is_default_constructible_safe;
664 // The following technique is a workaround for a current core language
665 // restriction, which does not allow for array types to occur in
666 // functional casts of the form T(). Complete arrays can be default-
667 // constructed, if the element type is default-constructible, but
668 // arrays with unknown bounds are not.
669 template<typename _Tp>
670 struct __is_default_constructible_safe<_Tp, true>
671 : public __and_<__is_array_known_bounds<_Tp>,
672 __is_default_constructible_atom<typename
673 remove_all_extents<_Tp>::type>>::type
676 template<typename _Tp>
677 struct __is_default_constructible_safe<_Tp, false>
678 : public __is_default_constructible_atom<_Tp>::type
681 /// is_default_constructible
682 template<typename _Tp>
683 struct is_default_constructible
684 : public integral_constant<bool, (__is_default_constructible_safe<
689 // Implementation of is_constructible.
691 // The hardest part of this trait is the binary direct-initialization
692 // case, because we hit into a functional cast of the form T(arg).
693 // This implementation uses different strategies depending on the
694 // target type to reduce the test overhead as much as possible:
696 // a) For a reference target type, we use a static_cast expression
697 // modulo its extra cases.
699 // b) For a non-reference target type we use a ::new expression.
700 struct __do_is_static_castable_impl
702 template<typename _From, typename _To, typename
703 = decltype(static_cast<_To>(declval<_From>()))>
704 static true_type __test(int);
706 template<typename, typename>
707 static false_type __test(...);
710 template<typename _From, typename _To>
711 struct __is_static_castable_impl
712 : public __do_is_static_castable_impl
714 typedef decltype(__test<_From, _To>(0)) type;
717 template<typename _From, typename _To>
718 struct __is_static_castable_safe
719 : public __is_static_castable_impl<_From, _To>::type
722 // __is_static_castable
723 template<typename _From, typename _To>
724 struct __is_static_castable
725 : public integral_constant<bool, (__is_static_castable_safe<
729 // Implementation for non-reference types. To meet the proper
730 // variable definition semantics, we also need to test for
731 // is_destructible in this case.
732 struct __do_is_direct_constructible_impl
734 template<typename _Tp, typename _Arg, typename
735 = decltype(::new _Tp(declval<_Arg>()))>
736 static true_type __test(int);
738 template<typename, typename>
739 static false_type __test(...);
742 template<typename _Tp, typename _Arg>
743 struct __is_direct_constructible_impl
744 : public __do_is_direct_constructible_impl
746 typedef decltype(__test<_Tp, _Arg>(0)) type;
749 template<typename _Tp, typename _Arg>
750 struct __is_direct_constructible_new_safe
751 : public __and_<is_destructible<_Tp>,
752 __is_direct_constructible_impl<_Tp, _Arg>>::type
755 template<typename, typename>
758 template<typename, typename>
762 struct remove_reference;
764 template<typename _From, typename _To, bool
765 = is_reference<_From>::value>
766 struct __is_base_to_derived_ref;
768 template<typename _From, typename _To>
769 struct __is_base_to_derived_ref<_From, _To, true>
771 typedef typename remove_cv<typename remove_reference<_From
772 >::type>::type __src_t;
773 typedef typename remove_cv<typename remove_reference<_To
774 >::type>::type __dst_t;
775 typedef __and_<__not_<is_same<__src_t, __dst_t>>,
776 is_base_of<__src_t, __dst_t>> type;
777 static constexpr bool value = type::value;
780 template<typename _From, typename _To>
781 struct __is_base_to_derived_ref<_From, _To, false>
785 template<typename _From, typename _To, bool
786 = __and_<is_lvalue_reference<_From>,
787 is_rvalue_reference<_To>>::value>
788 struct __is_lvalue_to_rvalue_ref;
790 template<typename _From, typename _To>
791 struct __is_lvalue_to_rvalue_ref<_From, _To, true>
793 typedef typename remove_cv<typename remove_reference<
794 _From>::type>::type __src_t;
795 typedef typename remove_cv<typename remove_reference<
796 _To>::type>::type __dst_t;
797 typedef __or_<is_same<__src_t, __dst_t>,
798 is_base_of<__dst_t, __src_t>> type;
799 static constexpr bool value = type::value;
802 template<typename _From, typename _To>
803 struct __is_lvalue_to_rvalue_ref<_From, _To, false>
807 // Here we handle direct-initialization to a reference type as
808 // equivalent to a static_cast modulo overshooting conversions.
809 // These are restricted to the following conversions:
810 // a) A glvalue of a base class to a derived class reference
811 // b) An lvalue to an rvalue-reference of reference-compatible
813 template<typename _Tp, typename _Arg>
814 struct __is_direct_constructible_ref_cast
815 : public __and_<__is_static_castable<_Arg, _Tp>,
816 __not_<__or_<__is_base_to_derived_ref<_Arg, _Tp>,
817 __is_lvalue_to_rvalue_ref<_Arg, _Tp>
821 template<typename _Tp, typename _Arg>
822 struct __is_direct_constructible_new
823 : public conditional<is_reference<_Tp>::value,
824 __is_direct_constructible_ref_cast<_Tp, _Arg>,
825 __is_direct_constructible_new_safe<_Tp, _Arg>
829 template<typename _Tp, typename _Arg>
830 struct __is_direct_constructible
831 : public integral_constant<bool, (__is_direct_constructible_new<
835 // Since default-construction and binary direct-initialization have
836 // been handled separately, the implementation of the remaining
837 // n-ary construction cases is rather straightforward.
838 struct __do_is_nary_constructible_impl
840 template<typename _Tp, typename... _Args, typename
841 = decltype(_Tp(declval<_Args>()...))>
842 static true_type __test(int);
844 template<typename, typename...>
845 static false_type __test(...);
848 template<typename _Tp, typename... _Args>
849 struct __is_nary_constructible_impl
850 : public __do_is_nary_constructible_impl
852 typedef decltype(__test<_Tp, _Args...>(0)) type;
855 template<typename _Tp, typename... _Args>
856 struct __is_nary_constructible
857 : public __is_nary_constructible_impl<_Tp, _Args...>::type
859 static_assert(sizeof...(_Args) > 1,
860 "Only useful for > 1 arguments");
863 template<typename _Tp, typename... _Args>
864 struct __is_constructible_impl
865 : public __is_nary_constructible<_Tp, _Args...>
868 template<typename _Tp, typename _Arg>
869 struct __is_constructible_impl<_Tp, _Arg>
870 : public __is_direct_constructible<_Tp, _Arg>
873 template<typename _Tp>
874 struct __is_constructible_impl<_Tp>
875 : public is_default_constructible<_Tp>
879 template<typename _Tp, typename... _Args>
880 struct is_constructible
881 : public integral_constant<bool, (__is_constructible_impl<_Tp,
885 template<typename _Tp, bool = is_void<_Tp>::value>
886 struct __is_copy_constructible_impl;
888 template<typename _Tp>
889 struct __is_copy_constructible_impl<_Tp, true>
890 : public false_type { };
892 template<typename _Tp>
893 struct __is_copy_constructible_impl<_Tp, false>
894 : public is_constructible<_Tp, const _Tp&>
897 /// is_copy_constructible
898 template<typename _Tp>
899 struct is_copy_constructible
900 : public __is_copy_constructible_impl<_Tp>
903 template<typename _Tp, bool = is_void<_Tp>::value>
904 struct __is_move_constructible_impl;
906 template<typename _Tp>
907 struct __is_move_constructible_impl<_Tp, true>
908 : public false_type { };
910 template<typename _Tp>
911 struct __is_move_constructible_impl<_Tp, false>
912 : public is_constructible<_Tp, _Tp&&>
915 /// is_move_constructible
916 template<typename _Tp>
917 struct is_move_constructible
918 : public __is_move_constructible_impl<_Tp>
921 template<typename _Tp>
922 struct __is_nt_default_constructible_atom
923 : public integral_constant<bool, noexcept(_Tp())>
926 template<typename _Tp, bool = is_array<_Tp>::value>
927 struct __is_nt_default_constructible_impl;
929 template<typename _Tp>
930 struct __is_nt_default_constructible_impl<_Tp, true>
931 : public __and_<__is_array_known_bounds<_Tp>,
932 __is_nt_default_constructible_atom<typename
933 remove_all_extents<_Tp>::type>>::type
936 template<typename _Tp>
937 struct __is_nt_default_constructible_impl<_Tp, false>
938 : public __is_nt_default_constructible_atom<_Tp>
941 /// is_nothrow_default_constructible
942 template<typename _Tp>
943 struct is_nothrow_default_constructible
944 : public __and_<is_default_constructible<_Tp>,
945 __is_nt_default_constructible_impl<_Tp>>::type
948 template<typename _Tp, typename... _Args>
949 struct __is_nt_constructible_impl
950 : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
953 template<typename _Tp, typename _Arg>
954 struct __is_nt_constructible_impl<_Tp, _Arg>
955 : public integral_constant<bool,
956 noexcept(static_cast<_Tp>(declval<_Arg>()))>
959 template<typename _Tp>
960 struct __is_nt_constructible_impl<_Tp>
961 : public is_nothrow_default_constructible<_Tp>
964 /// is_nothrow_constructible
965 template<typename _Tp, typename... _Args>
966 struct is_nothrow_constructible
967 : public __and_<is_constructible<_Tp, _Args...>,
968 __is_nt_constructible_impl<_Tp, _Args...>>::type
971 template<typename _Tp, bool = is_void<_Tp>::value>
972 struct __is_nothrow_copy_constructible_impl;
974 template<typename _Tp>
975 struct __is_nothrow_copy_constructible_impl<_Tp, true>
976 : public false_type { };
978 template<typename _Tp>
979 struct __is_nothrow_copy_constructible_impl<_Tp, false>
980 : public is_nothrow_constructible<_Tp, const _Tp&>
983 /// is_nothrow_copy_constructible
984 template<typename _Tp>
985 struct is_nothrow_copy_constructible
986 : public __is_nothrow_copy_constructible_impl<_Tp>
989 template<typename _Tp, bool = is_void<_Tp>::value>
990 struct __is_nothrow_move_constructible_impl;
992 template<typename _Tp>
993 struct __is_nothrow_move_constructible_impl<_Tp, true>
994 : public false_type { };
996 template<typename _Tp>
997 struct __is_nothrow_move_constructible_impl<_Tp, false>
998 : public is_nothrow_constructible<_Tp, _Tp&&>
1001 /// is_nothrow_move_constructible
1002 template<typename _Tp>
1003 struct is_nothrow_move_constructible
1004 : public __is_nothrow_move_constructible_impl<_Tp>
1007 template<typename _Tp, typename _Up>
1008 class __is_assignable_helper
1009 : public __sfinae_types
1011 template<typename _Tp1, typename _Up1>
1012 static decltype(declval<_Tp1>() = declval<_Up1>(), __one())
1015 template<typename, typename>
1016 static __two __test(...);
1019 static constexpr bool value = sizeof(__test<_Tp, _Up>(0)) == 1;
1023 template<typename _Tp, typename _Up>
1024 struct is_assignable
1025 : public integral_constant<bool,
1026 __is_assignable_helper<_Tp, _Up>::value>
1029 template<typename _Tp, bool = is_void<_Tp>::value>
1030 struct __is_copy_assignable_impl;
1032 template<typename _Tp>
1033 struct __is_copy_assignable_impl<_Tp, true>
1034 : public false_type { };
1036 template<typename _Tp>
1037 struct __is_copy_assignable_impl<_Tp, false>
1038 : public is_assignable<_Tp&, const _Tp&>
1041 /// is_copy_assignable
1042 template<typename _Tp>
1043 struct is_copy_assignable
1044 : public __is_copy_assignable_impl<_Tp>
1047 template<typename _Tp, bool = is_void<_Tp>::value>
1048 struct __is_move_assignable_impl;
1050 template<typename _Tp>
1051 struct __is_move_assignable_impl<_Tp, true>
1052 : public false_type { };
1054 template<typename _Tp>
1055 struct __is_move_assignable_impl<_Tp, false>
1056 : public is_assignable<_Tp&, _Tp&&>
1059 /// is_move_assignable
1060 template<typename _Tp>
1061 struct is_move_assignable
1062 : public __is_move_assignable_impl<_Tp>
1065 template<typename _Tp, typename _Up>
1066 struct __is_nt_assignable_impl
1067 : public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Up>())>
1070 /// is_nothrow_assignable
1071 template<typename _Tp, typename _Up>
1072 struct is_nothrow_assignable
1073 : public __and_<is_assignable<_Tp, _Up>,
1074 __is_nt_assignable_impl<_Tp, _Up>>::type
1077 template<typename _Tp, bool = is_void<_Tp>::value>
1078 struct __is_nt_copy_assignable_impl;
1080 template<typename _Tp>
1081 struct __is_nt_copy_assignable_impl<_Tp, true>
1082 : public false_type { };
1084 template<typename _Tp>
1085 struct __is_nt_copy_assignable_impl<_Tp, false>
1086 : public is_nothrow_assignable<_Tp&, const _Tp&>
1089 /// is_nothrow_copy_assignable
1090 template<typename _Tp>
1091 struct is_nothrow_copy_assignable
1092 : public __is_nt_copy_assignable_impl<_Tp>
1095 template<typename _Tp, bool = is_void<_Tp>::value>
1096 struct __is_nt_move_assignable_impl;
1098 template<typename _Tp>
1099 struct __is_nt_move_assignable_impl<_Tp, true>
1100 : public false_type { };
1102 template<typename _Tp>
1103 struct __is_nt_move_assignable_impl<_Tp, false>
1104 : public is_nothrow_assignable<_Tp&, _Tp&&>
1107 /// is_nothrow_move_assignable
1108 template<typename _Tp>
1109 struct is_nothrow_move_assignable
1110 : public __is_nt_move_assignable_impl<_Tp>
1113 /// has_trivial_default_constructor
1114 template<typename _Tp>
1115 struct has_trivial_default_constructor
1116 : public integral_constant<bool, __has_trivial_constructor(_Tp)>
1119 /// has_trivial_copy_constructor
1120 template<typename _Tp>
1121 struct has_trivial_copy_constructor
1122 : public integral_constant<bool, __has_trivial_copy(_Tp)>
1125 /// has_trivial_copy_assign
1126 template<typename _Tp>
1127 struct has_trivial_copy_assign
1128 : public integral_constant<bool, __has_trivial_assign(_Tp)>
1131 /// has_trivial_destructor
1132 template<typename _Tp>
1133 struct has_trivial_destructor
1134 : public integral_constant<bool, __has_trivial_destructor(_Tp)>
1137 /// has_virtual_destructor
1138 template<typename _Tp>
1139 struct has_virtual_destructor
1140 : public integral_constant<bool, __has_virtual_destructor(_Tp)>
1144 // type property queries.
1147 template<typename _Tp>
1149 : public integral_constant<std::size_t, __alignof__(_Tp)> { };
1154 : public integral_constant<std::size_t, 0> { };
1156 template<typename _Tp, std::size_t _Size>
1157 struct rank<_Tp[_Size]>
1158 : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1160 template<typename _Tp>
1162 : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
1165 template<typename, unsigned _Uint>
1167 : public integral_constant<std::size_t, 0> { };
1169 template<typename _Tp, unsigned _Uint, std::size_t _Size>
1170 struct extent<_Tp[_Size], _Uint>
1171 : public integral_constant<std::size_t,
1172 _Uint == 0 ? _Size : extent<_Tp,
1176 template<typename _Tp, unsigned _Uint>
1177 struct extent<_Tp[], _Uint>
1178 : public integral_constant<std::size_t,
1179 _Uint == 0 ? 0 : extent<_Tp,
1187 template<typename, typename>
1189 : public false_type { };
1191 template<typename _Tp>
1192 struct is_same<_Tp, _Tp>
1193 : public true_type { };
1196 template<typename _Base, typename _Derived>
1198 : public integral_constant<bool, __is_base_of(_Base, _Derived)>
1201 template<typename _From, typename _To,
1202 bool = __or_<is_void<_From>, is_function<_To>,
1203 is_array<_To>>::value>
1204 struct __is_convertible_helper
1205 { static constexpr bool value = is_void<_To>::value; };
1207 template<typename _From, typename _To>
1208 class __is_convertible_helper<_From, _To, false>
1209 : public __sfinae_types
1211 template<typename _To1>
1212 static void __test_aux(_To1);
1214 template<typename _From1, typename _To1>
1215 static decltype(__test_aux<_To1>(std::declval<_From1>()), __one())
1218 template<typename, typename>
1219 static __two __test(...);
1222 static constexpr bool value = sizeof(__test<_From, _To>(0)) == 1;
1226 template<typename _From, typename _To>
1227 struct is_convertible
1228 : public integral_constant<bool,
1229 __is_convertible_helper<_From, _To>::value>
1232 /// is_explicitly_convertible
1233 template<typename _From, typename _To>
1234 struct is_explicitly_convertible
1235 : public is_constructible<_To, _From>
1239 // const-volatile modifications.
1242 template<typename _Tp>
1244 { typedef _Tp type; };
1246 template<typename _Tp>
1247 struct remove_const<_Tp const>
1248 { typedef _Tp type; };
1251 template<typename _Tp>
1252 struct remove_volatile
1253 { typedef _Tp type; };
1255 template<typename _Tp>
1256 struct remove_volatile<_Tp volatile>
1257 { typedef _Tp type; };
1260 template<typename _Tp>
1264 remove_const<typename remove_volatile<_Tp>::type>::type type;
1268 template<typename _Tp>
1270 { typedef _Tp const type; };
1273 template<typename _Tp>
1275 { typedef _Tp volatile type; };
1278 template<typename _Tp>
1282 add_const<typename add_volatile<_Tp>::type>::type type;
1286 // Reference transformations.
1288 /// remove_reference
1289 template<typename _Tp>
1290 struct remove_reference
1291 { typedef _Tp type; };
1293 template<typename _Tp>
1294 struct remove_reference<_Tp&>
1295 { typedef _Tp type; };
1297 template<typename _Tp>
1298 struct remove_reference<_Tp&&>
1299 { typedef _Tp type; };
1301 template<typename _Tp,
1302 bool = __and_<__not_<is_reference<_Tp>>,
1303 __not_<is_void<_Tp>>>::value,
1304 bool = is_rvalue_reference<_Tp>::value>
1305 struct __add_lvalue_reference_helper
1306 { typedef _Tp type; };
1308 template<typename _Tp>
1309 struct __add_lvalue_reference_helper<_Tp, true, false>
1310 { typedef _Tp& type; };
1312 template<typename _Tp>
1313 struct __add_lvalue_reference_helper<_Tp, false, true>
1314 { typedef typename remove_reference<_Tp>::type& type; };
1316 /// add_lvalue_reference
1317 template<typename _Tp>
1318 struct add_lvalue_reference
1319 : public __add_lvalue_reference_helper<_Tp>
1322 template<typename _Tp,
1323 bool = __and_<__not_<is_reference<_Tp>>,
1324 __not_<is_void<_Tp>>>::value>
1325 struct __add_rvalue_reference_helper
1326 { typedef _Tp type; };
1328 template<typename _Tp>
1329 struct __add_rvalue_reference_helper<_Tp, true>
1330 { typedef _Tp&& type; };
1332 /// add_rvalue_reference
1333 template<typename _Tp>
1334 struct add_rvalue_reference
1335 : public __add_rvalue_reference_helper<_Tp>
1339 // sign modifications.
1341 // Utility for constructing identically cv-qualified types.
1342 template<typename _Unqualified, bool _IsConst, bool _IsVol>
1343 struct __cv_selector;
1345 template<typename _Unqualified>
1346 struct __cv_selector<_Unqualified, false, false>
1347 { typedef _Unqualified __type; };
1349 template<typename _Unqualified>
1350 struct __cv_selector<_Unqualified, false, true>
1351 { typedef volatile _Unqualified __type; };
1353 template<typename _Unqualified>
1354 struct __cv_selector<_Unqualified, true, false>
1355 { typedef const _Unqualified __type; };
1357 template<typename _Unqualified>
1358 struct __cv_selector<_Unqualified, true, true>
1359 { typedef const volatile _Unqualified __type; };
1361 template<typename _Qualified, typename _Unqualified,
1362 bool _IsConst = is_const<_Qualified>::value,
1363 bool _IsVol = is_volatile<_Qualified>::value>
1364 class __match_cv_qualifiers
1366 typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
1369 typedef typename __match::__type __type;
1372 // Utility for finding the unsigned versions of signed integral types.
1373 template<typename _Tp>
1374 struct __make_unsigned
1375 { typedef _Tp __type; };
1378 struct __make_unsigned<char>
1379 { typedef unsigned char __type; };
1382 struct __make_unsigned<signed char>
1383 { typedef unsigned char __type; };
1386 struct __make_unsigned<short>
1387 { typedef unsigned short __type; };
1390 struct __make_unsigned<int>
1391 { typedef unsigned int __type; };
1394 struct __make_unsigned<long>
1395 { typedef unsigned long __type; };
1398 struct __make_unsigned<long long>
1399 { typedef unsigned long long __type; };
1401 // Select between integral and enum: not possible to be both.
1402 template<typename _Tp,
1403 bool _IsInt = is_integral<_Tp>::value,
1404 bool _IsEnum = is_enum<_Tp>::value>
1405 class __make_unsigned_selector;
1407 template<typename _Tp>
1408 class __make_unsigned_selector<_Tp, true, false>
1410 typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
1411 typedef typename __unsignedt::__type __unsigned_type;
1412 typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
1415 typedef typename __cv_unsigned::__type __type;
1418 template<typename _Tp>
1419 class __make_unsigned_selector<_Tp, false, true>
1421 // With -fshort-enums, an enum may be as small as a char.
1422 typedef unsigned char __smallest;
1423 static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
1424 static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned short);
1425 static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned int);
1426 typedef conditional<__b2, unsigned int, unsigned long> __cond2;
1427 typedef typename __cond2::type __cond2_type;
1428 typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
1429 typedef typename __cond1::type __cond1_type;
1432 typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
1435 // Given an integral/enum type, return the corresponding unsigned
1437 // Primary template.
1439 template<typename _Tp>
1440 struct make_unsigned
1441 { typedef typename __make_unsigned_selector<_Tp>::__type type; };
1443 // Integral, but don't define.
1445 struct make_unsigned<bool>;
1448 // Utility for finding the signed versions of unsigned integral types.
1449 template<typename _Tp>
1450 struct __make_signed
1451 { typedef _Tp __type; };
1454 struct __make_signed<char>
1455 { typedef signed char __type; };
1458 struct __make_signed<unsigned char>
1459 { typedef signed char __type; };
1462 struct __make_signed<unsigned short>
1463 { typedef signed short __type; };
1466 struct __make_signed<unsigned int>
1467 { typedef signed int __type; };
1470 struct __make_signed<unsigned long>
1471 { typedef signed long __type; };
1474 struct __make_signed<unsigned long long>
1475 { typedef signed long long __type; };
1477 // Select between integral and enum: not possible to be both.
1478 template<typename _Tp,
1479 bool _IsInt = is_integral<_Tp>::value,
1480 bool _IsEnum = is_enum<_Tp>::value>
1481 class __make_signed_selector;
1483 template<typename _Tp>
1484 class __make_signed_selector<_Tp, true, false>
1486 typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
1487 typedef typename __signedt::__type __signed_type;
1488 typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
1491 typedef typename __cv_signed::__type __type;
1494 template<typename _Tp>
1495 class __make_signed_selector<_Tp, false, true>
1497 // With -fshort-enums, an enum may be as small as a char.
1498 typedef signed char __smallest;
1499 static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
1500 static const bool __b1 = sizeof(_Tp) <= sizeof(signed short);
1501 static const bool __b2 = sizeof(_Tp) <= sizeof(signed int);
1502 typedef conditional<__b2, signed int, signed long> __cond2;
1503 typedef typename __cond2::type __cond2_type;
1504 typedef conditional<__b1, signed short, __cond2_type> __cond1;
1505 typedef typename __cond1::type __cond1_type;
1508 typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
1511 // Given an integral/enum type, return the corresponding signed
1513 // Primary template.
1515 template<typename _Tp>
1517 { typedef typename __make_signed_selector<_Tp>::__type type; };
1519 // Integral, but don't define.
1521 struct make_signed<bool>;
1524 // array modifications.
1527 template<typename _Tp>
1528 struct remove_extent
1529 { typedef _Tp type; };
1531 template<typename _Tp, std::size_t _Size>
1532 struct remove_extent<_Tp[_Size]>
1533 { typedef _Tp type; };
1535 template<typename _Tp>
1536 struct remove_extent<_Tp[]>
1537 { typedef _Tp type; };
1539 /// remove_all_extents
1540 template<typename _Tp>
1541 struct remove_all_extents
1542 { typedef _Tp type; };
1544 template<typename _Tp, std::size_t _Size>
1545 struct remove_all_extents<_Tp[_Size]>
1546 { typedef typename remove_all_extents<_Tp>::type type; };
1548 template<typename _Tp>
1549 struct remove_all_extents<_Tp[]>
1550 { typedef typename remove_all_extents<_Tp>::type type; };
1553 // pointer modifications.
1555 template<typename _Tp, typename>
1556 struct __remove_pointer_helper
1557 { typedef _Tp type; };
1559 template<typename _Tp, typename _Up>
1560 struct __remove_pointer_helper<_Tp, _Up*>
1561 { typedef _Up type; };
1564 template<typename _Tp>
1565 struct remove_pointer
1566 : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
1570 template<typename _Tp>
1572 { typedef typename remove_reference<_Tp>::type* type; };
1575 template<std::size_t _Len>
1576 struct __aligned_storage_msa
1580 unsigned char __data[_Len];
1581 struct __attribute__((__aligned__)) { } __align;
1586 * @brief Alignment type.
1588 * The value of _Align is a default-alignment which shall be the
1589 * most stringent alignment requirement for any C++ object type
1590 * whose size is no greater than _Len (3.9). The member typedef
1591 * type shall be a POD type suitable for use as uninitialized
1592 * storage for any object whose size is at most _Len and whose
1593 * alignment is a divisor of _Align.
1595 template<std::size_t _Len, std::size_t _Align =
1596 __alignof__(typename __aligned_storage_msa<_Len>::__type)>
1597 struct aligned_storage
1601 unsigned char __data[_Len];
1602 struct __attribute__((__aligned__((_Align)))) { } __align;
1607 // Decay trait for arrays and functions, used for perfect forwarding
1608 // in make_pair, make_tuple, etc.
1609 template<typename _Up,
1610 bool _IsArray = is_array<_Up>::value,
1611 bool _IsFunction = is_function<_Up>::value>
1612 struct __decay_selector;
1615 template<typename _Up>
1616 struct __decay_selector<_Up, false, false>
1617 { typedef typename remove_cv<_Up>::type __type; };
1619 template<typename _Up>
1620 struct __decay_selector<_Up, true, false>
1621 { typedef typename remove_extent<_Up>::type* __type; };
1623 template<typename _Up>
1624 struct __decay_selector<_Up, false, true>
1625 { typedef typename add_pointer<_Up>::type __type; };
1628 template<typename _Tp>
1631 typedef typename remove_reference<_Tp>::type __remove_type;
1634 typedef typename __decay_selector<__remove_type>::__type type;
1637 template<typename _Tp>
1638 class reference_wrapper;
1640 // Helper which adds a reference to a type when given a reference_wrapper
1641 template<typename _Tp>
1642 struct __strip_reference_wrapper
1647 template<typename _Tp>
1648 struct __strip_reference_wrapper<reference_wrapper<_Tp> >
1650 typedef _Tp& __type;
1653 template<typename _Tp>
1654 struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
1656 typedef _Tp& __type;
1659 template<typename _Tp>
1660 struct __decay_and_strip
1662 typedef typename __strip_reference_wrapper<
1663 typename decay<_Tp>::type>::__type __type;
1667 // Define a nested type if some predicate holds.
1668 // Primary template.
1670 template<bool, typename _Tp = void>
1674 // Partial specialization for true.
1675 template<typename _Tp>
1676 struct enable_if<true, _Tp>
1677 { typedef _Tp type; };
1680 // A conditional expression, but for types. If true, first, if false, second.
1681 // Primary template.
1683 template<bool _Cond, typename _Iftrue, typename _Iffalse>
1685 { typedef _Iftrue type; };
1687 // Partial specialization for false.
1688 template<typename _Iftrue, typename _Iffalse>
1689 struct conditional<false, _Iftrue, _Iffalse>
1690 { typedef _Iffalse type; };
1694 template<typename... _Tp>
1697 template<typename _Tp>
1698 struct common_type<_Tp>
1699 { typedef _Tp type; };
1701 template<typename _Tp, typename _Up>
1702 struct common_type<_Tp, _Up>
1703 { typedef decltype(true ? declval<_Tp>() : declval<_Up>()) type; };
1705 template<typename _Tp, typename _Up, typename... _Vp>
1706 struct common_type<_Tp, _Up, _Vp...>
1709 common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type;
1713 template<typename _Tp>
1714 struct underlying_type
1716 typedef __underlying_type(_Tp) type;
1720 template<typename _Tp>
1721 struct __declval_protector
1723 static const bool __stop = false;
1724 static typename add_rvalue_reference<_Tp>::type __delegate();
1727 template<typename _Tp>
1728 inline typename add_rvalue_reference<_Tp>::type
1731 static_assert(__declval_protector<_Tp>::__stop,
1732 "declval() must not be used!");
1733 return __declval_protector<_Tp>::__delegate();
1737 template<typename _Signature>
1740 template<typename _MemPtr, typename _Arg>
1741 struct _Result_of_memobj;
1743 template<typename _Res, typename _Class, typename _Arg>
1744 struct _Result_of_memobj<_Res _Class::*, _Arg>
1747 typedef _Res _Class::* _Func;
1749 template<typename _Tp>
1750 static _Tp _S_get(const _Class&);
1751 template<typename _Tp>
1752 static decltype(*std::declval<_Tp>()) _S_get(...);
1756 decltype(_S_get<_Arg>(std::declval<_Arg>()).*std::declval<_Func>())
1760 template<typename _MemPtr, typename _Arg, typename... _ArgTypes>
1761 struct _Result_of_memfun;
1763 template<typename _Res, typename _Class, typename _Arg, typename... _Args>
1764 struct _Result_of_memfun<_Res _Class::*, _Arg, _Args...>
1767 typedef _Res _Class::* _Func;
1769 template<typename _Tp>
1770 static _Tp _S_get(const _Class&);
1771 template<typename _Tp>
1772 static decltype(*std::declval<_Tp>()) _S_get(...);
1776 decltype((_S_get<_Arg>(std::declval<_Arg>()).*std::declval<_Func>())
1777 (std::declval<_Args>()...) )
1781 template<bool, bool, typename _Functor, typename... _ArgTypes>
1782 struct _Result_of_impl;
1784 template<typename _Functor, typename... _ArgTypes>
1785 struct _Result_of_impl<false, false, _Functor, _ArgTypes...>
1788 decltype( std::declval<_Functor>()(std::declval<_ArgTypes>()...) )
1792 template<typename _MemPtr, typename _Arg>
1793 struct _Result_of_impl<true, false, _MemPtr, _Arg>
1794 : _Result_of_memobj<typename remove_reference<_MemPtr>::type, _Arg>
1796 typedef typename _Result_of_memobj<
1797 typename remove_reference<_MemPtr>::type, _Arg>::__type
1801 template<typename _MemPtr, typename _Arg, typename... _ArgTypes>
1802 struct _Result_of_impl<false, true, _MemPtr, _Arg, _ArgTypes...>
1803 : _Result_of_memfun<typename remove_reference<_MemPtr>::type, _Arg,
1806 typedef typename _Result_of_memfun<
1807 typename remove_reference<_MemPtr>::type, _Arg, _ArgTypes...>::__type
1811 template<typename _Functor, typename... _ArgTypes>
1812 struct result_of<_Functor(_ArgTypes...)>
1813 : _Result_of_impl<is_member_object_pointer<
1814 typename remove_reference<_Functor>::type >::value,
1815 is_member_function_pointer<
1816 typename remove_reference<_Functor>::type >::value,
1817 _Functor, _ArgTypes...>
1819 typedef typename _Result_of_impl<
1820 is_member_object_pointer<
1821 typename remove_reference<_Functor>::type >::value,
1822 is_member_function_pointer<
1823 typename remove_reference<_Functor>::type >::value,
1824 _Functor, _ArgTypes...>::__type
1829 * Use SFINAE to determine if the type _Tp has a publicly-accessible
1830 * member type _NTYPE.
1832 #define _GLIBCXX_HAS_NESTED_TYPE(_NTYPE) \
1833 template<typename _Tp> \
1834 class __has_##_NTYPE##_helper \
1837 template<typename _Up> \
1841 template<typename _Up> \
1842 static __one __test(_Wrap_type<typename _Up::_NTYPE>*); \
1844 template<typename _Up> \
1845 static __two __test(...); \
1848 static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; \
1851 template<typename _Tp> \
1852 struct __has_##_NTYPE \
1853 : integral_constant<bool, __has_##_NTYPE##_helper \
1854 <typename remove_cv<_Tp>::type>::value> \
1857 // @} group metaprogramming
1858 _GLIBCXX_END_NAMESPACE_VERSION
1861 #endif // __GXX_EXPERIMENTAL_CXX0X__
1863 #endif // _GLIBCXX_TYPE_TRAITS