Guest User

Untitled

a guest
Dec 1st, 2012
192
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
C++ 395.08 KB | None | 0 0
  1.        
  2. namespace std
  3. {
  4.   typedef long unsigned int size_t;
  5.   typedef long int ptrdiff_t;
  6.   typedef decltype(nullptr) nullptr_t;
  7. }
  8. namespace std __attribute__ ((__visibility__ ("default")))
  9. {
  10.  
  11.   void
  12.   __throw_bad_exception(void) __attribute__((__noreturn__));
  13.   void
  14.   __throw_bad_alloc(void) __attribute__((__noreturn__));
  15.   void
  16.   __throw_bad_cast(void) __attribute__((__noreturn__));
  17.   void
  18.   __throw_bad_typeid(void) __attribute__((__noreturn__));
  19.   void
  20.   __throw_logic_error(const char*) __attribute__((__noreturn__));
  21.   void
  22.   __throw_domain_error(const char*) __attribute__((__noreturn__));
  23.   void
  24.   __throw_invalid_argument(const char*) __attribute__((__noreturn__));
  25.   void
  26.   __throw_length_error(const char*) __attribute__((__noreturn__));
  27.   void
  28.   __throw_out_of_range(const char*) __attribute__((__noreturn__));
  29.   void
  30.   __throw_runtime_error(const char*) __attribute__((__noreturn__));
  31.   void
  32.   __throw_range_error(const char*) __attribute__((__noreturn__));
  33.   void
  34.   __throw_overflow_error(const char*) __attribute__((__noreturn__));
  35.   void
  36.   __throw_underflow_error(const char*) __attribute__((__noreturn__));
  37.   void
  38.   __throw_ios_failure(const char*) __attribute__((__noreturn__));
  39.   void
  40.   __throw_system_error(int) __attribute__((__noreturn__));
  41.   void
  42.   __throw_future_error(int) __attribute__((__noreturn__));
  43.   void
  44.   __throw_bad_function_call() __attribute__((__noreturn__));
  45.  
  46. }
  47.        
  48. namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
  49. {
  50.  
  51.   template<typename _Iterator, typename _Container>
  52.     class __normal_iterator;
  53.  
  54. }
  55. namespace std __attribute__ ((__visibility__ ("default")))
  56. {
  57.  
  58.   struct __true_type { };
  59.   struct __false_type { };
  60.   template<bool>
  61.     struct __truth_type
  62.     { typedef __false_type __type; };
  63.   template<>
  64.     struct __truth_type<true>
  65.     { typedef __true_type __type; };
  66.   template<class _Sp, class _Tp>
  67.     struct __traitor
  68.     {
  69.       enum { __value = bool(_Sp::__value) || bool(_Tp::__value) };
  70.       typedef typename __truth_type<__value>::__type __type;
  71.     };
  72.   template<typename, typename>
  73.     struct __are_same
  74.     {
  75.       enum { __value = 0 };
  76.       typedef __false_type __type;
  77.     };
  78.   template<typename _Tp>
  79.     struct __are_same<_Tp, _Tp>
  80.     {
  81.       enum { __value = 1 };
  82.       typedef __true_type __type;
  83.     };
  84.   template<typename _Tp>
  85.     struct __is_void
  86.     {
  87.       enum { __value = 0 };
  88.       typedef __false_type __type;
  89.     };
  90.   template<>
  91.     struct __is_void<void>
  92.     {
  93.       enum { __value = 1 };
  94.       typedef __true_type __type;
  95.     };
  96.   template<typename _Tp>
  97.     struct __is_integer
  98.     {
  99.       enum { __value = 0 };
  100.       typedef __false_type __type;
  101.     };
  102.   template<>
  103.     struct __is_integer<bool>
  104.     {
  105.       enum { __value = 1 };
  106.       typedef __true_type __type;
  107.     };
  108.   template<>
  109.     struct __is_integer<char>
  110.     {
  111.       enum { __value = 1 };
  112.       typedef __true_type __type;
  113.     };
  114.   template<>
  115.     struct __is_integer<signed char>
  116.     {
  117.       enum { __value = 1 };
  118.       typedef __true_type __type;
  119.     };
  120.   template<>
  121.     struct __is_integer<unsigned char>
  122.     {
  123.       enum { __value = 1 };
  124.       typedef __true_type __type;
  125.     };
  126.   template<>
  127.     struct __is_integer<wchar_t>
  128.     {
  129.       enum { __value = 1 };
  130.       typedef __true_type __type;
  131.     };
  132.   template<>
  133.     struct __is_integer<char16_t>
  134.     {
  135.       enum { __value = 1 };
  136.       typedef __true_type __type;
  137.     };
  138.   template<>
  139.     struct __is_integer<char32_t>
  140.     {
  141.       enum { __value = 1 };
  142.       typedef __true_type __type;
  143.     };
  144.   template<>
  145.     struct __is_integer<short>
  146.     {
  147.       enum { __value = 1 };
  148.       typedef __true_type __type;
  149.     };
  150.   template<>
  151.     struct __is_integer<unsigned short>
  152.     {
  153.       enum { __value = 1 };
  154.       typedef __true_type __type;
  155.     };
  156.   template<>
  157.     struct __is_integer<int>
  158.     {
  159.       enum { __value = 1 };
  160.       typedef __true_type __type;
  161.     };
  162.   template<>
  163.     struct __is_integer<unsigned int>
  164.     {
  165.       enum { __value = 1 };
  166.       typedef __true_type __type;
  167.     };
  168.   template<>
  169.     struct __is_integer<long>
  170.     {
  171.       enum { __value = 1 };
  172.       typedef __true_type __type;
  173.     };
  174.   template<>
  175.     struct __is_integer<unsigned long>
  176.     {
  177.       enum { __value = 1 };
  178.       typedef __true_type __type;
  179.     };
  180.   template<>
  181.     struct __is_integer<long long>
  182.     {
  183.       enum { __value = 1 };
  184.       typedef __true_type __type;
  185.     };
  186.   template<>
  187.     struct __is_integer<unsigned long long>
  188.     {
  189.       enum { __value = 1 };
  190.       typedef __true_type __type;
  191.     };
  192.   template<typename _Tp>
  193.     struct __is_floating
  194.     {
  195.       enum { __value = 0 };
  196.       typedef __false_type __type;
  197.     };
  198.   template<>
  199.     struct __is_floating<float>
  200.     {
  201.       enum { __value = 1 };
  202.       typedef __true_type __type;
  203.     };
  204.   template<>
  205.     struct __is_floating<double>
  206.     {
  207.       enum { __value = 1 };
  208.       typedef __true_type __type;
  209.     };
  210.   template<>
  211.     struct __is_floating<long double>
  212.     {
  213.       enum { __value = 1 };
  214.       typedef __true_type __type;
  215.     };
  216.   template<typename _Tp>
  217.     struct __is_pointer
  218.     {
  219.       enum { __value = 0 };
  220.       typedef __false_type __type;
  221.     };
  222.   template<typename _Tp>
  223.     struct __is_pointer<_Tp*>
  224.     {
  225.       enum { __value = 1 };
  226.       typedef __true_type __type;
  227.     };
  228.   template<typename _Tp>
  229.     struct __is_normal_iterator
  230.     {
  231.       enum { __value = 0 };
  232.       typedef __false_type __type;
  233.     };
  234.   template<typename _Iterator, typename _Container>
  235.     struct __is_normal_iterator< __gnu_cxx::__normal_iterator<_Iterator,
  236.              _Container> >
  237.     {
  238.       enum { __value = 1 };
  239.       typedef __true_type __type;
  240.     };
  241.   template<typename _Tp>
  242.     struct __is_arithmetic
  243.     : public __traitor<__is_integer<_Tp>, __is_floating<_Tp> >
  244.     { };
  245.   template<typename _Tp>
  246.     struct __is_fundamental
  247.     : public __traitor<__is_void<_Tp>, __is_arithmetic<_Tp> >
  248.     { };
  249.   template<typename _Tp>
  250.     struct __is_scalar
  251.     : public __traitor<__is_arithmetic<_Tp>, __is_pointer<_Tp> >
  252.     { };
  253.   template<typename _Tp>
  254.     struct __is_char
  255.     {
  256.       enum { __value = 0 };
  257.       typedef __false_type __type;
  258.     };
  259.   template<>
  260.     struct __is_char<char>
  261.     {
  262.       enum { __value = 1 };
  263.       typedef __true_type __type;
  264.     };
  265.   template<>
  266.     struct __is_char<wchar_t>
  267.     {
  268.       enum { __value = 1 };
  269.       typedef __true_type __type;
  270.     };
  271.   template<typename _Tp>
  272.     struct __is_byte
  273.     {
  274.       enum { __value = 0 };
  275.       typedef __false_type __type;
  276.     };
  277.   template<>
  278.     struct __is_byte<char>
  279.     {
  280.       enum { __value = 1 };
  281.       typedef __true_type __type;
  282.     };
  283.   template<>
  284.     struct __is_byte<signed char>
  285.     {
  286.       enum { __value = 1 };
  287.       typedef __true_type __type;
  288.     };
  289.   template<>
  290.     struct __is_byte<unsigned char>
  291.     {
  292.       enum { __value = 1 };
  293.       typedef __true_type __type;
  294.     };
  295.   template<typename _Tp>
  296.     struct __is_move_iterator
  297.     {
  298.       enum { __value = 0 };
  299.       typedef __false_type __type;
  300.     };
  301.   template<typename _Iterator>
  302.     class move_iterator;
  303.   template<typename _Iterator>
  304.     struct __is_move_iterator< move_iterator<_Iterator> >
  305.     {
  306.       enum { __value = 1 };
  307.       typedef __true_type __type;
  308.     };
  309.  
  310. }
  311.        
  312. namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
  313. {
  314.  
  315.   template<bool, typename>
  316.     struct __enable_if
  317.     { };
  318.   template<typename _Tp>
  319.     struct __enable_if<true, _Tp>
  320.     { typedef _Tp __type; };
  321.   template<bool _Cond, typename _Iftrue, typename _Iffalse>
  322.     struct __conditional_type
  323.     { typedef _Iftrue __type; };
  324.   template<typename _Iftrue, typename _Iffalse>
  325.     struct __conditional_type<false, _Iftrue, _Iffalse>
  326.     { typedef _Iffalse __type; };
  327.   template<typename _Tp>
  328.     struct __add_unsigned
  329.     {
  330.     private:
  331.       typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
  332.     public:
  333.       typedef typename __if_type::__type __type;
  334.     };
  335.   template<>
  336.     struct __add_unsigned<char>
  337.     { typedef unsigned char __type; };
  338.   template<>
  339.     struct __add_unsigned<signed char>
  340.     { typedef unsigned char __type; };
  341.   template<>
  342.     struct __add_unsigned<short>
  343.     { typedef unsigned short __type; };
  344.   template<>
  345.     struct __add_unsigned<int>
  346.     { typedef unsigned int __type; };
  347.   template<>
  348.     struct __add_unsigned<long>
  349.     { typedef unsigned long __type; };
  350.   template<>
  351.     struct __add_unsigned<long long>
  352.     { typedef unsigned long long __type; };
  353.   template<>
  354.     struct __add_unsigned<bool>;
  355.   template<>
  356.     struct __add_unsigned<wchar_t>;
  357.   template<typename _Tp>
  358.     struct __remove_unsigned
  359.     {
  360.     private:
  361.       typedef __enable_if<std::__is_integer<_Tp>::__value, _Tp> __if_type;
  362.     public:
  363.       typedef typename __if_type::__type __type;
  364.     };
  365.   template<>
  366.     struct __remove_unsigned<char>
  367.     { typedef signed char __type; };
  368.   template<>
  369.     struct __remove_unsigned<unsigned char>
  370.     { typedef signed char __type; };
  371.   template<>
  372.     struct __remove_unsigned<unsigned short>
  373.     { typedef short __type; };
  374.   template<>
  375.     struct __remove_unsigned<unsigned int>
  376.     { typedef int __type; };
  377.   template<>
  378.     struct __remove_unsigned<unsigned long>
  379.     { typedef long __type; };
  380.   template<>
  381.     struct __remove_unsigned<unsigned long long>
  382.     { typedef long long __type; };
  383.   template<>
  384.     struct __remove_unsigned<bool>;
  385.   template<>
  386.     struct __remove_unsigned<wchar_t>;
  387.   template<typename _Type>
  388.     inline bool
  389.     __is_null_pointer(_Type* __ptr)
  390.     { return __ptr == 0; }
  391.   template<typename _Type>
  392.     inline bool
  393.     __is_null_pointer(_Type)
  394.     { return false; }
  395.   template<typename _Tp, bool = std::__is_integer<_Tp>::__value>
  396.     struct __promote
  397.     { typedef double __type; };
  398.   template<typename _Tp>
  399.     struct __promote<_Tp, false>
  400.     { };
  401.   template<>
  402.     struct __promote<long double>
  403.     { typedef long double __type; };
  404.   template<>
  405.     struct __promote<double>
  406.     { typedef double __type; };
  407.   template<>
  408.     struct __promote<float>
  409.     { typedef float __type; };
  410.   template<typename _Tp, typename _Up,
  411.            typename _Tp2 = typename __promote<_Tp>::__type,
  412.            typename _Up2 = typename __promote<_Up>::__type>
  413.     struct __promote_2
  414.     {
  415.       typedef __typeof__(_Tp2() + _Up2()) __type;
  416.     };
  417.   template<typename _Tp, typename _Up, typename _Vp,
  418.            typename _Tp2 = typename __promote<_Tp>::__type,
  419.            typename _Up2 = typename __promote<_Up>::__type,
  420.            typename _Vp2 = typename __promote<_Vp>::__type>
  421.     struct __promote_3
  422.     {
  423.       typedef __typeof__(_Tp2() + _Up2() + _Vp2()) __type;
  424.     };
  425.   template<typename _Tp, typename _Up, typename _Vp, typename _Wp,
  426.            typename _Tp2 = typename __promote<_Tp>::__type,
  427.            typename _Up2 = typename __promote<_Up>::__type,
  428.            typename _Vp2 = typename __promote<_Vp>::__type,
  429.            typename _Wp2 = typename __promote<_Wp>::__type>
  430.     struct __promote_4
  431.     {
  432.       typedef __typeof__(_Tp2() + _Up2() + _Vp2() + _Wp2()) __type;
  433.     };
  434.  
  435. }
  436.        
  437. namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
  438. {
  439.  
  440.   template<typename _Value>
  441.     struct __numeric_traits_integer
  442.     {
  443.       static const _Value __min = (((_Value)(-1) < 0) ? (_Value)1 << (sizeof(_Value) * 8 - ((_Value)(-1) < 0)) : (_Value)0);
  444.       static const _Value __max = (((_Value)(-1) < 0) ? (((((_Value)1 << ((sizeof(_Value) * 8 - ((_Value)(-1) < 0)) - 1)) - 1) << 1) + 1) : ~(_Value)0);
  445.       static const bool __is_signed = ((_Value)(-1) < 0);
  446.       static const int __digits = (sizeof(_Value) * 8 - ((_Value)(-1) < 0));
  447.     };
  448.   template<typename _Value>
  449.     const _Value __numeric_traits_integer<_Value>::__min;
  450.   template<typename _Value>
  451.     const _Value __numeric_traits_integer<_Value>::__max;
  452.   template<typename _Value>
  453.     const bool __numeric_traits_integer<_Value>::__is_signed;
  454.   template<typename _Value>
  455.     const int __numeric_traits_integer<_Value>::__digits;
  456.   template<typename _Value>
  457.     struct __numeric_traits_floating
  458.     {
  459.       static const int __max_digits10 = (2 + (std::__are_same<_Value, float>::__value ? 24 : std::__are_same<_Value, double>::__value ? 53 : 64) * 643L / 2136);
  460.       static const bool __is_signed = true;
  461.       static const int __digits10 = (std::__are_same<_Value, float>::__value ? 6 : std::__are_same<_Value, double>::__value ? 15 : 18);
  462.       static const int __max_exponent10 = (std::__are_same<_Value, float>::__value ? 38 : std::__are_same<_Value, double>::__value ? 308 : 4932);
  463.     };
  464.   template<typename _Value>
  465.     const int __numeric_traits_floating<_Value>::__max_digits10;
  466.   template<typename _Value>
  467.     const bool __numeric_traits_floating<_Value>::__is_signed;
  468.   template<typename _Value>
  469.     const int __numeric_traits_floating<_Value>::__digits10;
  470.   template<typename _Value>
  471.     const int __numeric_traits_floating<_Value>::__max_exponent10;
  472.   template<typename _Value>
  473.     struct __numeric_traits
  474.     : public __conditional_type<std::__is_integer<_Value>::__value,
  475.     __numeric_traits_integer<_Value>,
  476.     __numeric_traits_floating<_Value> >::__type
  477.     { };
  478.  
  479. }
  480.        
  481. namespace std __attribute__ ((__visibility__ ("default")))
  482. {
  483.  
  484.   template<typename _Tp>
  485.     inline _Tp*
  486.     __addressof(_Tp& __r) noexcept
  487.     {
  488.       return reinterpret_cast<_Tp*>
  489.  (&const_cast<char&>(reinterpret_cast<const volatile char&>(__r)));
  490.     }
  491.  
  492. }
  493.        
  494. namespace std __attribute__ ((__visibility__ ("default")))
  495. {
  496.  
  497.   template<typename _Tp, _Tp __v>
  498.     struct integral_constant
  499.     {
  500.       static constexpr _Tp value = __v;
  501.       typedef _Tp value_type;
  502.       typedef integral_constant<_Tp, __v> type;
  503.       constexpr operator value_type() { return value; }
  504.     };
  505.   typedef integral_constant<bool, true> true_type;
  506.   typedef integral_constant<bool, false> false_type;
  507.   template<typename _Tp, _Tp __v>
  508.     constexpr _Tp integral_constant<_Tp, __v>::value;
  509.   template<bool, typename, typename>
  510.     struct conditional;
  511.   template<typename...>
  512.     struct __or_;
  513.   template<>
  514.     struct __or_<>
  515.     : public false_type
  516.     { };
  517.   template<typename _B1>
  518.     struct __or_<_B1>
  519.     : public _B1
  520.     { };
  521.   template<typename _B1, typename _B2>
  522.     struct __or_<_B1, _B2>
  523.     : public conditional<_B1::value, _B1, _B2>::type
  524.     { };
  525.   template<typename _B1, typename _B2, typename _B3, typename... _Bn>
  526.     struct __or_<_B1, _B2, _B3, _Bn...>
  527.     : public conditional<_B1::value, _B1, __or_<_B2, _B3, _Bn...>>::type
  528.     { };
  529.   template<typename...>
  530.     struct __and_;
  531.   template<>
  532.     struct __and_<>
  533.     : public true_type
  534.     { };
  535.   template<typename _B1>
  536.     struct __and_<_B1>
  537.     : public _B1
  538.     { };
  539.   template<typename _B1, typename _B2>
  540.     struct __and_<_B1, _B2>
  541.     : public conditional<_B1::value, _B2, _B1>::type
  542.     { };
  543.   template<typename _B1, typename _B2, typename _B3, typename... _Bn>
  544.     struct __and_<_B1, _B2, _B3, _Bn...>
  545.     : public conditional<_B1::value, __and_<_B2, _B3, _Bn...>, _B1>::type
  546.     { };
  547.   template<typename _Pp>
  548.     struct __not_
  549.     : public integral_constant<bool, !_Pp::value>
  550.     { };
  551.   struct __sfinae_types
  552.   {
  553.     typedef char __one;
  554.     typedef struct { char __arr[2]; } __two;
  555.   };
  556.   template<typename>
  557.     struct remove_cv;
  558.   template<typename>
  559.     struct __is_void_helper
  560.     : public false_type { };
  561.   template<>
  562.     struct __is_void_helper<void>
  563.     : public true_type { };
  564.   template<typename _Tp>
  565.     struct is_void
  566.     : public integral_constant<bool, (__is_void_helper<typename
  567.           remove_cv<_Tp>::type>::value)>
  568.     { };
  569.   template<typename>
  570.     struct __is_integral_helper
  571.     : public false_type { };
  572.   template<>
  573.     struct __is_integral_helper<bool>
  574.     : public true_type { };
  575.   template<>
  576.     struct __is_integral_helper<char>
  577.     : public true_type { };
  578.   template<>
  579.     struct __is_integral_helper<signed char>
  580.     : public true_type { };
  581.   template<>
  582.     struct __is_integral_helper<unsigned char>
  583.     : public true_type { };
  584.   template<>
  585.     struct __is_integral_helper<wchar_t>
  586.     : public true_type { };
  587.   template<>
  588.     struct __is_integral_helper<char16_t>
  589.     : public true_type { };
  590.   template<>
  591.     struct __is_integral_helper<char32_t>
  592.     : public true_type { };
  593.   template<>
  594.     struct __is_integral_helper<short>
  595.     : public true_type { };
  596.   template<>
  597.     struct __is_integral_helper<unsigned short>
  598.     : public true_type { };
  599.   template<>
  600.     struct __is_integral_helper<int>
  601.     : public true_type { };
  602.   template<>
  603.     struct __is_integral_helper<unsigned int>
  604.     : public true_type { };
  605.   template<>
  606.     struct __is_integral_helper<long>
  607.     : public true_type { };
  608.   template<>
  609.     struct __is_integral_helper<unsigned long>
  610.     : public true_type { };
  611.   template<>
  612.     struct __is_integral_helper<long long>
  613.     : public true_type { };
  614.   template<>
  615.     struct __is_integral_helper<unsigned long long>
  616.     : public true_type { };
  617.   template<>
  618.     struct __is_integral_helper<__int128>
  619.     : public true_type { };
  620.   template<>
  621.     struct __is_integral_helper<unsigned __int128>
  622.     : public true_type { };
  623.   template<typename _Tp>
  624.     struct is_integral
  625.     : public integral_constant<bool, (__is_integral_helper<typename
  626.           remove_cv<_Tp>::type>::value)>
  627.     { };
  628.   template<typename>
  629.     struct __is_floating_point_helper
  630.     : public false_type { };
  631.   template<>
  632.     struct __is_floating_point_helper<float>
  633.     : public true_type { };
  634.   template<>
  635.     struct __is_floating_point_helper<double>
  636.     : public true_type { };
  637.   template<>
  638.     struct __is_floating_point_helper<long double>
  639.     : public true_type { };
  640.   template<>
  641.     struct __is_floating_point_helper<__float128>
  642.     : public true_type { };
  643.   template<typename _Tp>
  644.     struct is_floating_point
  645.     : public integral_constant<bool, (__is_floating_point_helper<typename
  646.           remove_cv<_Tp>::type>::value)>
  647.     { };
  648.   template<typename>
  649.     struct is_array
  650.     : public false_type { };
  651.   template<typename _Tp, std::size_t _Size>
  652.     struct is_array<_Tp[_Size]>
  653.     : public true_type { };
  654.   template<typename _Tp>
  655.     struct is_array<_Tp[]>
  656.     : public true_type { };
  657.   template<typename>
  658.     struct __is_pointer_helper
  659.     : public false_type { };
  660.   template<typename _Tp>
  661.     struct __is_pointer_helper<_Tp*>
  662.     : public true_type { };
  663.   template<typename _Tp>
  664.     struct is_pointer
  665.     : public integral_constant<bool, (__is_pointer_helper<typename
  666.           remove_cv<_Tp>::type>::value)>
  667.     { };
  668.   template<typename>
  669.     struct is_lvalue_reference
  670.     : public false_type { };
  671.   template<typename _Tp>
  672.     struct is_lvalue_reference<_Tp&>
  673.     : public true_type { };
  674.   template<typename>
  675.     struct is_rvalue_reference
  676.     : public false_type { };
  677.   template<typename _Tp>
  678.     struct is_rvalue_reference<_Tp&&>
  679.     : public true_type { };
  680.   template<typename>
  681.     struct is_function;
  682.   template<typename>
  683.     struct __is_member_object_pointer_helper
  684.     : public false_type { };
  685.   template<typename _Tp, typename _Cp>
  686.     struct __is_member_object_pointer_helper<_Tp _Cp::*>
  687.     : public integral_constant<bool, !is_function<_Tp>::value> { };
  688.   template<typename _Tp>
  689.     struct is_member_object_pointer
  690.     : public integral_constant<bool, (__is_member_object_pointer_helper<
  691.           typename remove_cv<_Tp>::type>::value)>
  692.     { };
  693.   template<typename>
  694.     struct __is_member_function_pointer_helper
  695.     : public false_type { };
  696.   template<typename _Tp, typename _Cp>
  697.     struct __is_member_function_pointer_helper<_Tp _Cp::*>
  698.     : public integral_constant<bool, is_function<_Tp>::value> { };
  699.   template<typename _Tp>
  700.     struct is_member_function_pointer
  701.     : public integral_constant<bool, (__is_member_function_pointer_helper<
  702.           typename remove_cv<_Tp>::type>::value)>
  703.     { };
  704.   template<typename _Tp>
  705.     struct is_enum
  706.     : public integral_constant<bool, __is_enum(_Tp)>
  707.     { };
  708.   template<typename _Tp>
  709.     struct is_union
  710.     : public integral_constant<bool, __is_union(_Tp)>
  711.     { };
  712.   template<typename _Tp>
  713.     struct is_class
  714.     : public integral_constant<bool, __is_class(_Tp)>
  715.     { };
  716.   template<typename>
  717.     struct is_function
  718.     : public false_type { };
  719.   template<typename _Res, typename... _ArgTypes>
  720.     struct is_function<_Res(_ArgTypes...)>
  721.     : public true_type { };
  722.   template<typename _Res, typename... _ArgTypes>
  723.     struct is_function<_Res(_ArgTypes......)>
  724.     : public true_type { };
  725.   template<typename _Res, typename... _ArgTypes>
  726.     struct is_function<_Res(_ArgTypes...) const>
  727.     : public true_type { };
  728.   template<typename _Res, typename... _ArgTypes>
  729.     struct is_function<_Res(_ArgTypes......) const>
  730.     : public true_type { };
  731.   template<typename _Res, typename... _ArgTypes>
  732.     struct is_function<_Res(_ArgTypes...) volatile>
  733.     : public true_type { };
  734.   template<typename _Res, typename... _ArgTypes>
  735.     struct is_function<_Res(_ArgTypes......) volatile>
  736.     : public true_type { };
  737.   template<typename _Res, typename... _ArgTypes>
  738.     struct is_function<_Res(_ArgTypes...) const volatile>
  739.     : public true_type { };
  740.   template<typename _Res, typename... _ArgTypes>
  741.     struct is_function<_Res(_ArgTypes......) const volatile>
  742.     : public true_type { };
  743.   template<typename>
  744.     struct __is_nullptr_t_helper
  745.     : public false_type { };
  746.   template<>
  747.     struct __is_nullptr_t_helper<std::nullptr_t>
  748.     : public true_type { };
  749.   template<typename _Tp>
  750.     struct __is_nullptr_t
  751.     : public integral_constant<bool, (__is_nullptr_t_helper<typename
  752.           remove_cv<_Tp>::type>::value)>
  753.     { };
  754.   template<typename _Tp>
  755.     struct is_reference
  756.     : public __or_<is_lvalue_reference<_Tp>,
  757.                    is_rvalue_reference<_Tp>>::type
  758.     { };
  759.   template<typename _Tp>
  760.     struct is_arithmetic
  761.     : public __or_<is_integral<_Tp>, is_floating_point<_Tp>>::type
  762.     { };
  763.   template<typename _Tp>
  764.     struct is_fundamental
  765.     : public __or_<is_arithmetic<_Tp>, is_void<_Tp>>::type
  766.     { };
  767.   template<typename _Tp>
  768.     struct is_object
  769.     : public __not_<__or_<is_function<_Tp>, is_reference<_Tp>,
  770.                           is_void<_Tp>>>::type
  771.     { };
  772.   template<typename>
  773.     struct is_member_pointer;
  774.   template<typename _Tp>
  775.     struct is_scalar
  776.     : public __or_<is_arithmetic<_Tp>, is_enum<_Tp>, is_pointer<_Tp>,
  777.                    is_member_pointer<_Tp>, __is_nullptr_t<_Tp>>::type
  778.     { };
  779.   template<typename _Tp>
  780.     struct is_compound
  781.     : public integral_constant<bool, !is_fundamental<_Tp>::value> { };
  782.   template<typename _Tp>
  783.     struct __is_member_pointer_helper
  784.     : public false_type { };
  785.   template<typename _Tp, typename _Cp>
  786.     struct __is_member_pointer_helper<_Tp _Cp::*>
  787.     : public true_type { };
  788.   template<typename _Tp>
  789.     struct is_member_pointer
  790.     : public integral_constant<bool, (__is_member_pointer_helper<
  791.           typename remove_cv<_Tp>::type>::value)>
  792.     { };
  793.   template<typename>
  794.     struct is_const
  795.     : public false_type { };
  796.   template<typename _Tp>
  797.     struct is_const<_Tp const>
  798.     : public true_type { };
  799.   template<typename>
  800.     struct is_volatile
  801.     : public false_type { };
  802.   template<typename _Tp>
  803.     struct is_volatile<_Tp volatile>
  804.     : public true_type { };
  805.   template<typename _Tp>
  806.     struct is_trivial
  807.     : public integral_constant<bool, __is_trivial(_Tp)>
  808.     { };
  809.   template<typename _Tp>
  810.     struct is_standard_layout
  811.     : public integral_constant<bool, __is_standard_layout(_Tp)>
  812.     { };
  813.   template<typename _Tp>
  814.     struct is_pod
  815.     : public integral_constant<bool, __is_pod(_Tp)>
  816.     { };
  817.   template<typename _Tp>
  818.     struct is_literal_type
  819.     : public integral_constant<bool, __is_literal_type(_Tp)>
  820.     { };
  821.   template<typename _Tp>
  822.     struct is_empty
  823.     : public integral_constant<bool, __is_empty(_Tp)>
  824.     { };
  825.   template<typename _Tp>
  826.     struct is_polymorphic
  827.     : public integral_constant<bool, __is_polymorphic(_Tp)>
  828.     { };
  829.   template<typename _Tp>
  830.     struct is_abstract
  831.     : public integral_constant<bool, __is_abstract(_Tp)>
  832.     { };
  833.   template<typename _Tp,
  834.     bool = is_integral<_Tp>::value,
  835.     bool = is_floating_point<_Tp>::value>
  836.     struct __is_signed_helper
  837.     : public false_type { };
  838.   template<typename _Tp>
  839.     struct __is_signed_helper<_Tp, false, true>
  840.     : public true_type { };
  841.   template<typename _Tp>
  842.     struct __is_signed_helper<_Tp, true, false>
  843.     : public integral_constant<bool, static_cast<bool>(_Tp(-1) < _Tp(0))>
  844.     { };
  845.   template<typename _Tp>
  846.     struct is_signed
  847.     : public integral_constant<bool, __is_signed_helper<_Tp>::value>
  848.     { };
  849.   template<typename _Tp>
  850.     struct is_unsigned
  851.     : public __and_<is_arithmetic<_Tp>, __not_<is_signed<_Tp>>>::type
  852.     { };
  853.   template<typename>
  854.     struct add_rvalue_reference;
  855.   template<typename _Tp>
  856.     typename add_rvalue_reference<_Tp>::type declval() noexcept;
  857.   template<typename, unsigned = 0>
  858.     struct extent;
  859.   template<typename>
  860.     struct remove_all_extents;
  861.   template<typename _Tp>
  862.     struct __is_array_known_bounds
  863.     : public integral_constant<bool, (extent<_Tp>::value > 0)>
  864.     { };
  865.   template<typename _Tp>
  866.     struct __is_array_unknown_bounds
  867.     : public __and_<is_array<_Tp>, __not_<extent<_Tp>>>::type
  868.     { };
  869.   struct __do_is_destructible_impl_1
  870.   {
  871.     template<typename _Up>
  872.       struct __w { _Up __u; };
  873.     template<typename _Tp, typename
  874.              = decltype(declval<__w<_Tp>&>().~__w<_Tp>())>
  875.       static true_type __test(int);
  876.     template<typename>
  877.       static false_type __test(...);
  878.   };
  879.   template<typename _Tp>
  880.     struct __is_destructible_impl_1
  881.     : public __do_is_destructible_impl_1
  882.     {
  883.       typedef decltype(__test<_Tp>(0)) type;
  884.     };
  885.   struct __do_is_destructible_impl_2
  886.   {
  887.     template<typename _Tp, typename = decltype(declval<_Tp&>().~_Tp())>
  888.       static true_type __test(int);
  889.     template<typename>
  890.       static false_type __test(...);
  891.   };
  892.   template<typename _Tp>
  893.     struct __is_destructible_impl_2
  894.     : public __do_is_destructible_impl_2
  895.     {
  896.       typedef decltype(__test<_Tp>(0)) type;
  897.     };
  898.   template<typename _Tp,
  899.            bool = __or_<is_void<_Tp>,
  900.                         __is_array_unknown_bounds<_Tp>>::value,
  901.            bool = __or_<is_reference<_Tp>, is_function<_Tp>>::value>
  902.     struct __is_destructible_safe;
  903.   template<typename _Tp>
  904.     struct __is_destructible_safe<_Tp, false, false>
  905.     : public conditional<is_abstract<_Tp>::value,
  906.     __is_destructible_impl_2<_Tp>,
  907.                          __is_destructible_impl_1<_Tp>>::type::type
  908.     { };
  909.   template<typename _Tp>
  910.     struct __is_destructible_safe<_Tp, true, false>
  911.     : public false_type { };
  912.   template<typename _Tp>
  913.     struct __is_destructible_safe<_Tp, false, true>
  914.     : public true_type { };
  915.   template<typename _Tp>
  916.     struct is_destructible
  917.     : public integral_constant<bool, (__is_destructible_safe<_Tp>::value)>
  918.     { };
  919.   struct __do_is_default_constructible_impl
  920.   {
  921.     template<typename _Tp, typename = decltype(_Tp())>
  922.       static true_type __test(int);
  923.     template<typename>
  924.       static false_type __test(...);
  925.   };
  926.   template<typename _Tp>
  927.     struct __is_default_constructible_impl
  928.     : public __do_is_default_constructible_impl
  929.     {
  930.       typedef decltype(__test<_Tp>(0)) type;
  931.     };
  932.   template<typename _Tp>
  933.     struct __is_default_constructible_atom
  934.     : public __and_<__not_<is_void<_Tp>>,
  935.                     __is_default_constructible_impl<_Tp>>::type
  936.     { };
  937.   template<typename _Tp, bool = is_array<_Tp>::value>
  938.     struct __is_default_constructible_safe;
  939.   template<typename _Tp>
  940.     struct __is_default_constructible_safe<_Tp, true>
  941.     : public __and_<__is_array_known_bounds<_Tp>,
  942.       __is_default_constructible_atom<typename
  943.                       remove_all_extents<_Tp>::type>>::type
  944.     { };
  945.   template<typename _Tp>
  946.     struct __is_default_constructible_safe<_Tp, false>
  947.     : public __is_default_constructible_atom<_Tp>::type
  948.     { };
  949.   template<typename _Tp>
  950.     struct is_default_constructible
  951.     : public integral_constant<bool, (__is_default_constructible_safe<
  952.           _Tp>::value)>
  953.     { };
  954.   struct __do_is_static_castable_impl
  955.   {
  956.     template<typename _From, typename _To, typename
  957.              = decltype(static_cast<_To>(declval<_From>()))>
  958.       static true_type __test(int);
  959.     template<typename, typename>
  960.       static false_type __test(...);
  961.   };
  962.   template<typename _From, typename _To>
  963.     struct __is_static_castable_impl
  964.     : public __do_is_static_castable_impl
  965.     {
  966.       typedef decltype(__test<_From, _To>(0)) type;
  967.     };
  968.   template<typename _From, typename _To>
  969.     struct __is_static_castable_safe
  970.     : public __is_static_castable_impl<_From, _To>::type
  971.     { };
  972.   template<typename _From, typename _To>
  973.     struct __is_static_castable
  974.     : public integral_constant<bool, (__is_static_castable_safe<
  975.           _From, _To>::value)>
  976.     { };
  977.   struct __do_is_direct_constructible_impl
  978.   {
  979.     template<typename _Tp, typename _Arg, typename
  980.       = decltype(::new _Tp(declval<_Arg>()))>
  981.       static true_type __test(int);
  982.     template<typename, typename>
  983.       static false_type __test(...);
  984.   };
  985.   template<typename _Tp, typename _Arg>
  986.     struct __is_direct_constructible_impl
  987.     : public __do_is_direct_constructible_impl
  988.     {
  989.       typedef decltype(__test<_Tp, _Arg>(0)) type;
  990.     };
  991.   template<typename _Tp, typename _Arg>
  992.     struct __is_direct_constructible_new_safe
  993.     : public __and_<is_destructible<_Tp>,
  994.                     __is_direct_constructible_impl<_Tp, _Arg>>::type
  995.     { };
  996.   template<typename, typename>
  997.     struct is_same;
  998.   template<typename, typename>
  999.     struct is_base_of;
  1000.   template<typename>
  1001.     struct remove_reference;
  1002.   template<typename _From, typename _To, bool
  1003.            = __not_<__or_<is_void<_From>,
  1004.                           is_function<_From>>>::value>
  1005.     struct __is_base_to_derived_ref;
  1006.   template<typename _From, typename _To>
  1007.     struct __is_base_to_derived_ref<_From, _To, true>
  1008.     {
  1009.       typedef typename remove_cv<typename remove_reference<_From
  1010.         >::type>::type __src_t;
  1011.       typedef typename remove_cv<typename remove_reference<_To
  1012.         >::type>::type __dst_t;
  1013.       typedef __and_<__not_<is_same<__src_t, __dst_t>>,
  1014.        is_base_of<__src_t, __dst_t>> type;
  1015.       static constexpr bool value = type::value;
  1016.     };
  1017.   template<typename _From, typename _To>
  1018.     struct __is_base_to_derived_ref<_From, _To, false>
  1019.     : public false_type
  1020.     { };
  1021.   template<typename _From, typename _To, bool
  1022.            = __and_<is_lvalue_reference<_From>,
  1023.                     is_rvalue_reference<_To>>::value>
  1024.     struct __is_lvalue_to_rvalue_ref;
  1025.   template<typename _From, typename _To>
  1026.     struct __is_lvalue_to_rvalue_ref<_From, _To, true>
  1027.     {
  1028.       typedef typename remove_cv<typename remove_reference<
  1029.         _From>::type>::type __src_t;
  1030.       typedef typename remove_cv<typename remove_reference<
  1031.         _To>::type>::type __dst_t;
  1032.       typedef __and_<__not_<is_function<__src_t>>,
  1033.         __or_<is_same<__src_t, __dst_t>,
  1034.       is_base_of<__dst_t, __src_t>>> type;
  1035.       static constexpr bool value = type::value;
  1036.     };
  1037.   template<typename _From, typename _To>
  1038.     struct __is_lvalue_to_rvalue_ref<_From, _To, false>
  1039.     : public false_type
  1040.     { };
  1041.   template<typename _Tp, typename _Arg>
  1042.     struct __is_direct_constructible_ref_cast
  1043.     : public __and_<__is_static_castable<_Arg, _Tp>,
  1044.                     __not_<__or_<__is_base_to_derived_ref<_Arg, _Tp>,
  1045.                                  __is_lvalue_to_rvalue_ref<_Arg, _Tp>
  1046.                    >>>::type
  1047.     { };
  1048.   template<typename _Tp, typename _Arg>
  1049.     struct __is_direct_constructible_new
  1050.     : public conditional<is_reference<_Tp>::value,
  1051.     __is_direct_constructible_ref_cast<_Tp, _Arg>,
  1052.     __is_direct_constructible_new_safe<_Tp, _Arg>
  1053.     >::type
  1054.     { };
  1055.   template<typename _Tp, typename _Arg>
  1056.     struct __is_direct_constructible
  1057.     : public integral_constant<bool, (__is_direct_constructible_new<
  1058.           _Tp, _Arg>::value)>
  1059.     { };
  1060.   struct __do_is_nary_constructible_impl
  1061.   {
  1062.     template<typename _Tp, typename... _Args, typename
  1063.              = decltype(_Tp(declval<_Args>()...))>
  1064.       static true_type __test(int);
  1065.     template<typename, typename...>
  1066.       static false_type __test(...);
  1067.   };
  1068.   template<typename _Tp, typename... _Args>
  1069.     struct __is_nary_constructible_impl
  1070.     : public __do_is_nary_constructible_impl
  1071.     {
  1072.       typedef decltype(__test<_Tp, _Args...>(0)) type;
  1073.     };
  1074.   template<typename _Tp, typename... _Args>
  1075.     struct __is_nary_constructible
  1076.     : public __is_nary_constructible_impl<_Tp, _Args...>::type
  1077.     {
  1078.       static_assert(sizeof...(_Args) > 1,
  1079.                     "Only useful for > 1 arguments");
  1080.     };
  1081.   template<typename _Tp, typename... _Args>
  1082.     struct __is_constructible_impl
  1083.     : public __is_nary_constructible<_Tp, _Args...>
  1084.     { };
  1085.   template<typename _Tp, typename _Arg>
  1086.     struct __is_constructible_impl<_Tp, _Arg>
  1087.     : public __is_direct_constructible<_Tp, _Arg>
  1088.     { };
  1089.   template<typename _Tp>
  1090.     struct __is_constructible_impl<_Tp>
  1091.     : public is_default_constructible<_Tp>
  1092.     { };
  1093.   template<typename _Tp, typename... _Args>
  1094.     struct is_constructible
  1095.     : public integral_constant<bool, (__is_constructible_impl<_Tp,
  1096.           _Args...>::value)>
  1097.     { };
  1098.   template<typename _Tp, bool = is_void<_Tp>::value>
  1099.     struct __is_copy_constructible_impl;
  1100.   template<typename _Tp>
  1101.     struct __is_copy_constructible_impl<_Tp, true>
  1102.     : public false_type { };
  1103.   template<typename _Tp>
  1104.     struct __is_copy_constructible_impl<_Tp, false>
  1105.     : public is_constructible<_Tp, const _Tp&>
  1106.     { };
  1107.   template<typename _Tp>
  1108.     struct is_copy_constructible
  1109.     : public __is_copy_constructible_impl<_Tp>
  1110.     { };
  1111.   template<typename _Tp, bool = is_void<_Tp>::value>
  1112.     struct __is_move_constructible_impl;
  1113.   template<typename _Tp>
  1114.     struct __is_move_constructible_impl<_Tp, true>
  1115.     : public false_type { };
  1116.   template<typename _Tp>
  1117.     struct __is_move_constructible_impl<_Tp, false>
  1118.     : public is_constructible<_Tp, _Tp&&>
  1119.     { };
  1120.   template<typename _Tp>
  1121.     struct is_move_constructible
  1122.     : public __is_move_constructible_impl<_Tp>
  1123.     { };
  1124.   template<typename _Tp>
  1125.     struct __is_nt_default_constructible_atom
  1126.     : public integral_constant<bool, noexcept(_Tp())>
  1127.     { };
  1128.   template<typename _Tp, bool = is_array<_Tp>::value>
  1129.     struct __is_nt_default_constructible_impl;
  1130.   template<typename _Tp>
  1131.     struct __is_nt_default_constructible_impl<_Tp, true>
  1132.     : public __and_<__is_array_known_bounds<_Tp>,
  1133.       __is_nt_default_constructible_atom<typename
  1134.                       remove_all_extents<_Tp>::type>>::type
  1135.     { };
  1136.   template<typename _Tp>
  1137.     struct __is_nt_default_constructible_impl<_Tp, false>
  1138.     : public __is_nt_default_constructible_atom<_Tp>
  1139.     { };
  1140.   template<typename _Tp>
  1141.     struct is_nothrow_default_constructible
  1142.     : public __and_<is_default_constructible<_Tp>,
  1143.                     __is_nt_default_constructible_impl<_Tp>>::type
  1144.     { };
  1145.   template<typename _Tp, typename... _Args>
  1146.     struct __is_nt_constructible_impl
  1147.     : public integral_constant<bool, noexcept(_Tp(declval<_Args>()...))>
  1148.     { };
  1149.   template<typename _Tp, typename _Arg>
  1150.     struct __is_nt_constructible_impl<_Tp, _Arg>
  1151.     : public integral_constant<bool,
  1152.                                noexcept(static_cast<_Tp>(declval<_Arg>()))>
  1153.     { };
  1154.   template<typename _Tp>
  1155.     struct __is_nt_constructible_impl<_Tp>
  1156.     : public is_nothrow_default_constructible<_Tp>
  1157.     { };
  1158.   template<typename _Tp, typename... _Args>
  1159.     struct is_nothrow_constructible
  1160.     : public __and_<is_constructible<_Tp, _Args...>,
  1161.       __is_nt_constructible_impl<_Tp, _Args...>>::type
  1162.     { };
  1163.   template<typename _Tp, bool = is_void<_Tp>::value>
  1164.     struct __is_nothrow_copy_constructible_impl;
  1165.   template<typename _Tp>
  1166.     struct __is_nothrow_copy_constructible_impl<_Tp, true>
  1167.     : public false_type { };
  1168.   template<typename _Tp>
  1169.     struct __is_nothrow_copy_constructible_impl<_Tp, false>
  1170.     : public is_nothrow_constructible<_Tp, const _Tp&>
  1171.     { };
  1172.   template<typename _Tp>
  1173.     struct is_nothrow_copy_constructible
  1174.     : public __is_nothrow_copy_constructible_impl<_Tp>
  1175.     { };
  1176.   template<typename _Tp, bool = is_void<_Tp>::value>
  1177.     struct __is_nothrow_move_constructible_impl;
  1178.   template<typename _Tp>
  1179.     struct __is_nothrow_move_constructible_impl<_Tp, true>
  1180.     : public false_type { };
  1181.   template<typename _Tp>
  1182.     struct __is_nothrow_move_constructible_impl<_Tp, false>
  1183.     : public is_nothrow_constructible<_Tp, _Tp&&>
  1184.     { };
  1185.   template<typename _Tp>
  1186.     struct is_nothrow_move_constructible
  1187.     : public __is_nothrow_move_constructible_impl<_Tp>
  1188.     { };
  1189.   template<typename _Tp, typename _Up>
  1190.     class __is_assignable_helper
  1191.     : public __sfinae_types
  1192.     {
  1193.       template<typename _Tp1, typename _Up1>
  1194.         static decltype(declval<_Tp1>() = declval<_Up1>(), __one())
  1195.  __test(int);
  1196.       template<typename, typename>
  1197.         static __two __test(...);
  1198.     public:
  1199.       static constexpr bool value = sizeof(__test<_Tp, _Up>(0)) == 1;
  1200.     };
  1201.   template<typename _Tp, typename _Up>
  1202.     struct is_assignable
  1203.     : public integral_constant<bool,
  1204.                                __is_assignable_helper<_Tp, _Up>::value>
  1205.     { };
  1206.   template<typename _Tp, bool = is_void<_Tp>::value>
  1207.     struct __is_copy_assignable_impl;
  1208.   template<typename _Tp>
  1209.     struct __is_copy_assignable_impl<_Tp, true>
  1210.     : public false_type { };
  1211.   template<typename _Tp>
  1212.     struct __is_copy_assignable_impl<_Tp, false>
  1213.     : public is_assignable<_Tp&, const _Tp&>
  1214.     { };
  1215.   template<typename _Tp>
  1216.     struct is_copy_assignable
  1217.     : public __is_copy_assignable_impl<_Tp>
  1218.     { };
  1219.   template<typename _Tp, bool = is_void<_Tp>::value>
  1220.     struct __is_move_assignable_impl;
  1221.   template<typename _Tp>
  1222.     struct __is_move_assignable_impl<_Tp, true>
  1223.     : public false_type { };
  1224.   template<typename _Tp>
  1225.     struct __is_move_assignable_impl<_Tp, false>
  1226.     : public is_assignable<_Tp&, _Tp&&>
  1227.     { };
  1228.   template<typename _Tp>
  1229.     struct is_move_assignable
  1230.     : public __is_move_assignable_impl<_Tp>
  1231.     { };
  1232.   template<typename _Tp, typename _Up>
  1233.     struct __is_nt_assignable_impl
  1234.     : public integral_constant<bool, noexcept(declval<_Tp>() = declval<_Up>())>
  1235.     { };
  1236.   template<typename _Tp, typename _Up>
  1237.     struct is_nothrow_assignable
  1238.     : public __and_<is_assignable<_Tp, _Up>,
  1239.       __is_nt_assignable_impl<_Tp, _Up>>::type
  1240.     { };
  1241.   template<typename _Tp, bool = is_void<_Tp>::value>
  1242.     struct __is_nt_copy_assignable_impl;
  1243.   template<typename _Tp>
  1244.     struct __is_nt_copy_assignable_impl<_Tp, true>
  1245.     : public false_type { };
  1246.   template<typename _Tp>
  1247.     struct __is_nt_copy_assignable_impl<_Tp, false>
  1248.     : public is_nothrow_assignable<_Tp&, const _Tp&>
  1249.     { };
  1250.   template<typename _Tp>
  1251.     struct is_nothrow_copy_assignable
  1252.     : public __is_nt_copy_assignable_impl<_Tp>
  1253.     { };
  1254.   template<typename _Tp, bool = is_void<_Tp>::value>
  1255.     struct __is_nt_move_assignable_impl;
  1256.   template<typename _Tp>
  1257.     struct __is_nt_move_assignable_impl<_Tp, true>
  1258.     : public false_type { };
  1259.   template<typename _Tp>
  1260.     struct __is_nt_move_assignable_impl<_Tp, false>
  1261.     : public is_nothrow_assignable<_Tp&, _Tp&&>
  1262.     { };
  1263.   template<typename _Tp>
  1264.     struct is_nothrow_move_assignable
  1265.     : public __is_nt_move_assignable_impl<_Tp>
  1266.     { };
  1267.   template<typename _Tp>
  1268.     struct has_trivial_default_constructor
  1269.     : public integral_constant<bool, __has_trivial_constructor(_Tp)>
  1270.     { };
  1271.   template<typename _Tp>
  1272.     struct has_trivial_copy_constructor
  1273.     : public integral_constant<bool, __has_trivial_copy(_Tp)>
  1274.     { };
  1275.   template<typename _Tp>
  1276.     struct has_trivial_copy_assign
  1277.     : public integral_constant<bool, __has_trivial_assign(_Tp)>
  1278.     { };
  1279.   template<typename _Tp>
  1280.     struct has_trivial_destructor
  1281.     : public integral_constant<bool, __has_trivial_destructor(_Tp)>
  1282.     { };
  1283.   template<typename _Tp>
  1284.     struct has_virtual_destructor
  1285.     : public integral_constant<bool, __has_virtual_destructor(_Tp)>
  1286.     { };
  1287.   template<typename _Tp>
  1288.     struct alignment_of
  1289.     : public integral_constant<std::size_t, __alignof__(_Tp)> { };
  1290.   template<typename>
  1291.     struct rank
  1292.     : public integral_constant<std::size_t, 0> { };
  1293.   template<typename _Tp, std::size_t _Size>
  1294.     struct rank<_Tp[_Size]>
  1295.     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
  1296.   template<typename _Tp>
  1297.     struct rank<_Tp[]>
  1298.     : public integral_constant<std::size_t, 1 + rank<_Tp>::value> { };
  1299.   template<typename, unsigned _Uint>
  1300.     struct extent
  1301.     : public integral_constant<std::size_t, 0> { };
  1302.   template<typename _Tp, unsigned _Uint, std::size_t _Size>
  1303.     struct extent<_Tp[_Size], _Uint>
  1304.     : public integral_constant<std::size_t,
  1305.           _Uint == 0 ? _Size : extent<_Tp,
  1306.           _Uint - 1>::value>
  1307.     { };
  1308.   template<typename _Tp, unsigned _Uint>
  1309.     struct extent<_Tp[], _Uint>
  1310.     : public integral_constant<std::size_t,
  1311.           _Uint == 0 ? 0 : extent<_Tp,
  1312.              _Uint - 1>::value>
  1313.     { };
  1314.   template<typename, typename>
  1315.     struct is_same
  1316.     : public false_type { };
  1317.   template<typename _Tp>
  1318.     struct is_same<_Tp, _Tp>
  1319.     : public true_type { };
  1320.   template<typename _Base, typename _Derived>
  1321.     struct is_base_of
  1322.     : public integral_constant<bool, __is_base_of(_Base, _Derived)>
  1323.     { };
  1324.   template<typename _From, typename _To,
  1325.            bool = __or_<is_void<_From>, is_function<_To>,
  1326.                         is_array<_To>>::value>
  1327.     struct __is_convertible_helper
  1328.     { static constexpr bool value = is_void<_To>::value; };
  1329.   template<typename _From, typename _To>
  1330.     class __is_convertible_helper<_From, _To, false>
  1331.     : public __sfinae_types
  1332.     {
  1333.       template<typename _To1>
  1334.         static void __test_aux(_To1);
  1335.       template<typename _From1, typename _To1>
  1336.         static decltype(__test_aux<_To1>(std::declval<_From1>()), __one())
  1337.  __test(int);
  1338.       template<typename, typename>
  1339.         static __two __test(...);
  1340.     public:
  1341.       static constexpr bool value = sizeof(__test<_From, _To>(0)) == 1;
  1342.     };
  1343.   template<typename _From, typename _To>
  1344.     struct is_convertible
  1345.     : public integral_constant<bool,
  1346.           __is_convertible_helper<_From, _To>::value>
  1347.     { };
  1348.   template<typename _From, typename _To>
  1349.     struct is_explicitly_convertible
  1350.     : public is_constructible<_To, _From>
  1351.     { };
  1352.   template<typename _Tp>
  1353.     struct remove_const
  1354.     { typedef _Tp type; };
  1355.   template<typename _Tp>
  1356.     struct remove_const<_Tp const>
  1357.     { typedef _Tp type; };
  1358.   template<typename _Tp>
  1359.     struct remove_volatile
  1360.     { typedef _Tp type; };
  1361.   template<typename _Tp>
  1362.     struct remove_volatile<_Tp volatile>
  1363.     { typedef _Tp type; };
  1364.   template<typename _Tp>
  1365.     struct remove_cv
  1366.     {
  1367.       typedef typename
  1368.       remove_const<typename remove_volatile<_Tp>::type>::type type;
  1369.     };
  1370.   template<typename _Tp>
  1371.     struct add_const
  1372.     { typedef _Tp const type; };
  1373.   template<typename _Tp>
  1374.     struct add_volatile
  1375.     { typedef _Tp volatile type; };
  1376.   template<typename _Tp>
  1377.     struct add_cv
  1378.     {
  1379.       typedef typename
  1380.       add_const<typename add_volatile<_Tp>::type>::type type;
  1381.     };
  1382.   template<typename _Tp>
  1383.     struct remove_reference
  1384.     { typedef _Tp type; };
  1385.   template<typename _Tp>
  1386.     struct remove_reference<_Tp&>
  1387.     { typedef _Tp type; };
  1388.   template<typename _Tp>
  1389.     struct remove_reference<_Tp&&>
  1390.     { typedef _Tp type; };
  1391.   template<typename _Tp,
  1392.     bool = __and_<__not_<is_reference<_Tp>>,
  1393.                          __not_<is_void<_Tp>>>::value,
  1394.     bool = is_rvalue_reference<_Tp>::value>
  1395.     struct __add_lvalue_reference_helper
  1396.     { typedef _Tp type; };
  1397.   template<typename _Tp>
  1398.     struct __add_lvalue_reference_helper<_Tp, true, false>
  1399.     { typedef _Tp& type; };
  1400.   template<typename _Tp>
  1401.     struct __add_lvalue_reference_helper<_Tp, false, true>
  1402.     { typedef typename remove_reference<_Tp>::type& type; };
  1403.   template<typename _Tp>
  1404.     struct add_lvalue_reference
  1405.     : public __add_lvalue_reference_helper<_Tp>
  1406.     { };
  1407.   template<typename _Tp,
  1408.            bool = __and_<__not_<is_reference<_Tp>>,
  1409.                          __not_<is_void<_Tp>>>::value>
  1410.     struct __add_rvalue_reference_helper
  1411.     { typedef _Tp type; };
  1412.   template<typename _Tp>
  1413.     struct __add_rvalue_reference_helper<_Tp, true>
  1414.     { typedef _Tp&& type; };
  1415.   template<typename _Tp>
  1416.     struct add_rvalue_reference
  1417.     : public __add_rvalue_reference_helper<_Tp>
  1418.     { };
  1419.   template<typename _Unqualified, bool _IsConst, bool _IsVol>
  1420.     struct __cv_selector;
  1421.   template<typename _Unqualified>
  1422.     struct __cv_selector<_Unqualified, false, false>
  1423.     { typedef _Unqualified __type; };
  1424.   template<typename _Unqualified>
  1425.     struct __cv_selector<_Unqualified, false, true>
  1426.     { typedef volatile _Unqualified __type; };
  1427.   template<typename _Unqualified>
  1428.     struct __cv_selector<_Unqualified, true, false>
  1429.     { typedef const _Unqualified __type; };
  1430.   template<typename _Unqualified>
  1431.     struct __cv_selector<_Unqualified, true, true>
  1432.     { typedef const volatile _Unqualified __type; };
  1433.   template<typename _Qualified, typename _Unqualified,
  1434.     bool _IsConst = is_const<_Qualified>::value,
  1435.     bool _IsVol = is_volatile<_Qualified>::value>
  1436.     class __match_cv_qualifiers
  1437.     {
  1438.       typedef __cv_selector<_Unqualified, _IsConst, _IsVol> __match;
  1439.     public:
  1440.       typedef typename __match::__type __type;
  1441.     };
  1442.   template<typename _Tp>
  1443.     struct __make_unsigned
  1444.     { typedef _Tp __type; };
  1445.   template<>
  1446.     struct __make_unsigned<char>
  1447.     { typedef unsigned char __type; };
  1448.   template<>
  1449.     struct __make_unsigned<signed char>
  1450.     { typedef unsigned char __type; };
  1451.   template<>
  1452.     struct __make_unsigned<short>
  1453.     { typedef unsigned short __type; };
  1454.   template<>
  1455.     struct __make_unsigned<int>
  1456.     { typedef unsigned int __type; };
  1457.   template<>
  1458.     struct __make_unsigned<long>
  1459.     { typedef unsigned long __type; };
  1460.   template<>
  1461.     struct __make_unsigned<long long>
  1462.     { typedef unsigned long long __type; };
  1463.   template<>
  1464.     struct __make_unsigned<__int128>
  1465.     { typedef unsigned __int128 __type; };
  1466.   template<typename _Tp,
  1467.     bool _IsInt = is_integral<_Tp>::value,
  1468.     bool _IsEnum = is_enum<_Tp>::value>
  1469.     class __make_unsigned_selector;
  1470.   template<typename _Tp>
  1471.     class __make_unsigned_selector<_Tp, true, false>
  1472.     {
  1473.       typedef __make_unsigned<typename remove_cv<_Tp>::type> __unsignedt;
  1474.       typedef typename __unsignedt::__type __unsigned_type;
  1475.       typedef __match_cv_qualifiers<_Tp, __unsigned_type> __cv_unsigned;
  1476.     public:
  1477.       typedef typename __cv_unsigned::__type __type;
  1478.     };
  1479.   template<typename _Tp>
  1480.     class __make_unsigned_selector<_Tp, false, true>
  1481.     {
  1482.       typedef unsigned char __smallest;
  1483.       static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
  1484.       static const bool __b1 = sizeof(_Tp) <= sizeof(unsigned short);
  1485.       static const bool __b2 = sizeof(_Tp) <= sizeof(unsigned int);
  1486.       typedef conditional<__b2, unsigned int, unsigned long> __cond2;
  1487.       typedef typename __cond2::type __cond2_type;
  1488.       typedef conditional<__b1, unsigned short, __cond2_type> __cond1;
  1489.       typedef typename __cond1::type __cond1_type;
  1490.     public:
  1491.       typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
  1492.     };
  1493.   template<typename _Tp>
  1494.     struct make_unsigned
  1495.     { typedef typename __make_unsigned_selector<_Tp>::__type type; };
  1496.   template<>
  1497.     struct make_unsigned<bool>;
  1498.   template<typename _Tp>
  1499.     struct __make_signed
  1500.     { typedef _Tp __type; };
  1501.   template<>
  1502.     struct __make_signed<char>
  1503.     { typedef signed char __type; };
  1504.   template<>
  1505.     struct __make_signed<unsigned char>
  1506.     { typedef signed char __type; };
  1507.   template<>
  1508.     struct __make_signed<unsigned short>
  1509.     { typedef signed short __type; };
  1510.   template<>
  1511.     struct __make_signed<unsigned int>
  1512.     { typedef signed int __type; };
  1513.   template<>
  1514.     struct __make_signed<unsigned long>
  1515.     { typedef signed long __type; };
  1516.   template<>
  1517.     struct __make_signed<unsigned long long>
  1518.     { typedef signed long long __type; };
  1519.   template<>
  1520.     struct __make_signed<unsigned __int128>
  1521.     { typedef __int128 __type; };
  1522.   template<typename _Tp,
  1523.     bool _IsInt = is_integral<_Tp>::value,
  1524.     bool _IsEnum = is_enum<_Tp>::value>
  1525.     class __make_signed_selector;
  1526.   template<typename _Tp>
  1527.     class __make_signed_selector<_Tp, true, false>
  1528.     {
  1529.       typedef __make_signed<typename remove_cv<_Tp>::type> __signedt;
  1530.       typedef typename __signedt::__type __signed_type;
  1531.       typedef __match_cv_qualifiers<_Tp, __signed_type> __cv_signed;
  1532.     public:
  1533.       typedef typename __cv_signed::__type __type;
  1534.     };
  1535.   template<typename _Tp>
  1536.     class __make_signed_selector<_Tp, false, true>
  1537.     {
  1538.       typedef signed char __smallest;
  1539.       static const bool __b0 = sizeof(_Tp) <= sizeof(__smallest);
  1540.       static const bool __b1 = sizeof(_Tp) <= sizeof(signed short);
  1541.       static const bool __b2 = sizeof(_Tp) <= sizeof(signed int);
  1542.       typedef conditional<__b2, signed int, signed long> __cond2;
  1543.       typedef typename __cond2::type __cond2_type;
  1544.       typedef conditional<__b1, signed short, __cond2_type> __cond1;
  1545.       typedef typename __cond1::type __cond1_type;
  1546.     public:
  1547.       typedef typename conditional<__b0, __smallest, __cond1_type>::type __type;
  1548.     };
  1549.   template<typename _Tp>
  1550.     struct make_signed
  1551.     { typedef typename __make_signed_selector<_Tp>::__type type; };
  1552.   template<>
  1553.     struct make_signed<bool>;
  1554.   template<typename _Tp>
  1555.     struct remove_extent
  1556.     { typedef _Tp type; };
  1557.   template<typename _Tp, std::size_t _Size>
  1558.     struct remove_extent<_Tp[_Size]>
  1559.     { typedef _Tp type; };
  1560.   template<typename _Tp>
  1561.     struct remove_extent<_Tp[]>
  1562.     { typedef _Tp type; };
  1563.   template<typename _Tp>
  1564.     struct remove_all_extents
  1565.     { typedef _Tp type; };
  1566.   template<typename _Tp, std::size_t _Size>
  1567.     struct remove_all_extents<_Tp[_Size]>
  1568.     { typedef typename remove_all_extents<_Tp>::type type; };
  1569.   template<typename _Tp>
  1570.     struct remove_all_extents<_Tp[]>
  1571.     { typedef typename remove_all_extents<_Tp>::type type; };
  1572.   template<typename _Tp, typename>
  1573.     struct __remove_pointer_helper
  1574.     { typedef _Tp type; };
  1575.   template<typename _Tp, typename _Up>
  1576.     struct __remove_pointer_helper<_Tp, _Up*>
  1577.     { typedef _Up type; };
  1578.   template<typename _Tp>
  1579.     struct remove_pointer
  1580.     : public __remove_pointer_helper<_Tp, typename remove_cv<_Tp>::type>
  1581.     { };
  1582.   template<typename _Tp>
  1583.     struct add_pointer
  1584.     { typedef typename remove_reference<_Tp>::type* type; };
  1585.   template<std::size_t _Len>
  1586.     struct __aligned_storage_msa
  1587.     {
  1588.       union __type
  1589.       {
  1590.  unsigned char __data[_Len];
  1591.  struct __attribute__((__aligned__)) { } __align;
  1592.       };
  1593.     };
  1594.   template<std::size_t _Len, std::size_t _Align =
  1595.     __alignof__(typename __aligned_storage_msa<_Len>::__type)>
  1596.     struct aligned_storage
  1597.     {
  1598.       union type
  1599.       {
  1600.  unsigned char __data[_Len];
  1601.  struct __attribute__((__aligned__((_Align)))) { } __align;
  1602.       };
  1603.     };
  1604.   template<typename _Up,
  1605.     bool _IsArray = is_array<_Up>::value,
  1606.     bool _IsFunction = is_function<_Up>::value>
  1607.     struct __decay_selector;
  1608.   template<typename _Up>
  1609.     struct __decay_selector<_Up, false, false>
  1610.     { typedef typename remove_cv<_Up>::type __type; };
  1611.   template<typename _Up>
  1612.     struct __decay_selector<_Up, true, false>
  1613.     { typedef typename remove_extent<_Up>::type* __type; };
  1614.   template<typename _Up>
  1615.     struct __decay_selector<_Up, false, true>
  1616.     { typedef typename add_pointer<_Up>::type __type; };
  1617.   template<typename _Tp>
  1618.     class decay
  1619.     {
  1620.       typedef typename remove_reference<_Tp>::type __remove_type;
  1621.     public:
  1622.       typedef typename __decay_selector<__remove_type>::__type type;
  1623.     };
  1624.   template<typename _Tp>
  1625.     class reference_wrapper;
  1626.   template<typename _Tp>
  1627.     struct __strip_reference_wrapper
  1628.     {
  1629.       typedef _Tp __type;
  1630.     };
  1631.   template<typename _Tp>
  1632.     struct __strip_reference_wrapper<reference_wrapper<_Tp> >
  1633.     {
  1634.       typedef _Tp& __type;
  1635.     };
  1636.   template<typename _Tp>
  1637.     struct __strip_reference_wrapper<const reference_wrapper<_Tp> >
  1638.     {
  1639.       typedef _Tp& __type;
  1640.     };
  1641.   template<typename _Tp>
  1642.     struct __decay_and_strip
  1643.     {
  1644.       typedef typename __strip_reference_wrapper<
  1645.  typename decay<_Tp>::type>::__type __type;
  1646.     };
  1647.   template<bool, typename _Tp = void>
  1648.     struct enable_if
  1649.     { };
  1650.   template<typename _Tp>
  1651.     struct enable_if<true, _Tp>
  1652.     { typedef _Tp type; };
  1653.   template<bool _Cond, typename _Iftrue, typename _Iffalse>
  1654.     struct conditional
  1655.     { typedef _Iftrue type; };
  1656.   template<typename _Iftrue, typename _Iffalse>
  1657.     struct conditional<false, _Iftrue, _Iffalse>
  1658.     { typedef _Iffalse type; };
  1659.   template<typename... _Tp>
  1660.     struct common_type;
  1661.   template<typename _Tp>
  1662.     struct common_type<_Tp>
  1663.     { typedef _Tp type; };
  1664.   template<typename _Tp, typename _Up>
  1665.     struct common_type<_Tp, _Up>
  1666.     { typedef decltype(true ? declval<_Tp>() : declval<_Up>()) type; };
  1667.   template<typename _Tp, typename _Up, typename... _Vp>
  1668.     struct common_type<_Tp, _Up, _Vp...>
  1669.     {
  1670.       typedef typename
  1671.         common_type<typename common_type<_Tp, _Up>::type, _Vp...>::type type;
  1672.     };
  1673.   template<typename _Tp>
  1674.     struct underlying_type
  1675.     {
  1676.       typedef __underlying_type(_Tp) type;
  1677.     };
  1678.   template<typename _Tp>
  1679.     struct __declval_protector
  1680.     {
  1681.       static const bool __stop = false;
  1682.       static typename add_rvalue_reference<_Tp>::type __delegate();
  1683.     };
  1684.   template<typename _Tp>
  1685.     inline typename add_rvalue_reference<_Tp>::type
  1686.     declval() noexcept
  1687.     {
  1688.       static_assert(__declval_protector<_Tp>::__stop,
  1689.       "declval() must not be used!");
  1690.       return __declval_protector<_Tp>::__delegate();
  1691.     }
  1692.   template<typename _Signature>
  1693.     class result_of;
  1694.   template<typename _MemPtr, typename _Arg>
  1695.     struct _Result_of_memobj;
  1696.   template<typename _Res, typename _Class, typename _Arg>
  1697.     struct _Result_of_memobj<_Res _Class::*, _Arg>
  1698.     {
  1699.     private:
  1700.       typedef _Res _Class::* _Func;
  1701.       template<typename _Tp>
  1702.  static _Tp _S_get(const _Class&);
  1703.       template<typename _Tp>
  1704.  static decltype(*std::declval<_Tp>()) _S_get(...);
  1705.     public:
  1706.       typedef
  1707.         decltype(_S_get<_Arg>(std::declval<_Arg>()).*std::declval<_Func>())
  1708.         __type;
  1709.     };
  1710.   template<typename _MemPtr, typename _Arg, typename... _ArgTypes>
  1711.     struct _Result_of_memfun;
  1712.   template<typename _Res, typename _Class, typename _Arg, typename... _Args>
  1713.     struct _Result_of_memfun<_Res _Class::*, _Arg, _Args...>
  1714.     {
  1715.     private:
  1716.       typedef _Res _Class::* _Func;
  1717.       template<typename _Tp>
  1718.  static _Tp _S_get(const _Class&);
  1719.       template<typename _Tp>
  1720.  static decltype(*std::declval<_Tp>()) _S_get(...);
  1721.     public:
  1722.       typedef
  1723.         decltype((_S_get<_Arg>(std::declval<_Arg>()).*std::declval<_Func>())
  1724.             (std::declval<_Args>()...) )
  1725.         __type;
  1726.     };
  1727.   template<bool, bool, typename _Functor, typename... _ArgTypes>
  1728.     struct _Result_of_impl;
  1729.   template<typename _Functor, typename... _ArgTypes>
  1730.     struct _Result_of_impl<false, false, _Functor, _ArgTypes...>
  1731.     {
  1732.       typedef
  1733.         decltype( std::declval<_Functor>()(std::declval<_ArgTypes>()...) )
  1734.         __type;
  1735.     };
  1736.   template<typename _MemPtr, typename _Arg>
  1737.     struct _Result_of_impl<true, false, _MemPtr, _Arg>
  1738.     : _Result_of_memobj<typename remove_reference<_MemPtr>::type, _Arg>
  1739.     {
  1740.       typedef typename _Result_of_memobj<
  1741.  typename remove_reference<_MemPtr>::type, _Arg>::__type
  1742.  __type;
  1743.     };
  1744.   template<typename _MemPtr, typename _Arg, typename... _ArgTypes>
  1745.     struct _Result_of_impl<false, true, _MemPtr, _Arg, _ArgTypes...>
  1746.     : _Result_of_memfun<typename remove_reference<_MemPtr>::type, _Arg,
  1747.                         _ArgTypes...>
  1748.     {
  1749.       typedef typename _Result_of_memfun<
  1750.  typename remove_reference<_MemPtr>::type, _Arg, _ArgTypes...>::__type
  1751.  __type;
  1752.     };
  1753.   template<typename _Functor, typename... _ArgTypes>
  1754.     struct result_of<_Functor(_ArgTypes...)>
  1755.     : _Result_of_impl<is_member_object_pointer<
  1756.                         typename remove_reference<_Functor>::type >::value,
  1757.                       is_member_function_pointer<
  1758.    typename remove_reference<_Functor>::type >::value,
  1759.         _Functor, _ArgTypes...>
  1760.     {
  1761.       typedef typename _Result_of_impl<
  1762.  is_member_object_pointer<
  1763.    typename remove_reference<_Functor>::type >::value,
  1764.         is_member_function_pointer<
  1765.    typename remove_reference<_Functor>::type >::value,
  1766.         _Functor, _ArgTypes...>::__type
  1767.  type;
  1768.     };
  1769.  
  1770. }
  1771. namespace std __attribute__ ((__visibility__ ("default")))
  1772. {
  1773.  
  1774.   template<typename _Tp>
  1775.     constexpr _Tp&&
  1776.     forward(typename std::remove_reference<_Tp>::type& __t) noexcept
  1777.     { return static_cast<_Tp&&>(__t); }
  1778.   template<typename _Tp>
  1779.     constexpr _Tp&&
  1780.     forward(typename std::remove_reference<_Tp>::type&& __t) noexcept
  1781.     {
  1782.       static_assert(!std::is_lvalue_reference<_Tp>::value, "template argument"
  1783.       " substituting _Tp is an lvalue reference type");
  1784.       return static_cast<_Tp&&>(__t);
  1785.     }
  1786.   template<typename _Tp>
  1787.     constexpr typename std::remove_reference<_Tp>::type&&
  1788.     move(_Tp&& __t) noexcept
  1789.     { return static_cast<typename std::remove_reference<_Tp>::type&&>(__t); }
  1790.   template<typename _Tp>
  1791.     struct __move_if_noexcept_cond
  1792.     : public __and_<__not_<is_nothrow_move_constructible<_Tp>>,
  1793.                     is_copy_constructible<_Tp>>::type { };
  1794.   template<typename _Tp>
  1795.     inline typename
  1796.     conditional<__move_if_noexcept_cond<_Tp>::value, const _Tp&, _Tp&&>::type
  1797.     move_if_noexcept(_Tp& __x) noexcept
  1798.     { return std::move(__x); }
  1799.   template<typename _Tp>
  1800.     inline _Tp*
  1801.     addressof(_Tp& __r) noexcept
  1802.     { return std::__addressof(__r); }
  1803.  
  1804. }
  1805. namespace std __attribute__ ((__visibility__ ("default")))
  1806. {
  1807.  
  1808.   template<typename _Tp>
  1809.     inline void
  1810.     swap(_Tp& __a, _Tp& __b)
  1811.     noexcept(__and_<is_nothrow_move_constructible<_Tp>,
  1812.              is_nothrow_move_assignable<_Tp>>::value)
  1813.     {
  1814.      
  1815.       _Tp __tmp = std::move(__a);
  1816.       __a = std::move(__b);
  1817.       __b = std::move(__tmp);
  1818.     }
  1819.   template<typename _Tp, size_t _Nm>
  1820.     inline void
  1821.     swap(_Tp (&__a)[_Nm], _Tp (&__b)[_Nm])
  1822.     noexcept(noexcept(swap(*__a, *__b)))
  1823.     {
  1824.       for (size_t __n = 0; __n < _Nm; ++__n)
  1825.  swap(__a[__n], __b[__n]);
  1826.     }
  1827.  
  1828. }
  1829. namespace std __attribute__ ((__visibility__ ("default")))
  1830. {
  1831.  
  1832.   struct piecewise_construct_t { };
  1833.   constexpr piecewise_construct_t piecewise_construct = piecewise_construct_t();
  1834.   template<typename...>
  1835.     class tuple;
  1836.   template<std::size_t...>
  1837.     struct _Index_tuple;
  1838.   template<class _T1, class _T2>
  1839.     struct pair
  1840.     {
  1841.       typedef _T1 first_type;
  1842.       typedef _T2 second_type;
  1843.       _T1 first;
  1844.       _T2 second;
  1845.       constexpr pair()
  1846.       : first(), second() { }
  1847.       constexpr pair(const _T1& __a, const _T2& __b)
  1848.       : first(__a), second(__b) { }
  1849.       template<class _U1, class _U2, class = typename
  1850.         enable_if<__and_<is_convertible<const _U1&, _T1>,
  1851.     is_convertible<const _U2&, _T2>>::value>::type>
  1852.  constexpr pair(const pair<_U1, _U2>& __p)
  1853.  : first(__p.first), second(__p.second) { }
  1854.       constexpr pair(const pair&) = default;
  1855.       constexpr pair(pair&&) = default;
  1856.       template<class _U1, class = typename
  1857.         enable_if<is_convertible<_U1, _T1>::value>::type>
  1858.  constexpr pair(_U1&& __x, const _T2& __y)
  1859.  : first(std::forward<_U1>(__x)), second(__y) { }
  1860.       template<class _U2, class = typename
  1861.         enable_if<is_convertible<_U2, _T2>::value>::type>
  1862.  constexpr pair(const _T1& __x, _U2&& __y)
  1863.  : first(__x), second(std::forward<_U2>(__y)) { }
  1864.       template<class _U1, class _U2, class = typename
  1865.         enable_if<__and_<is_convertible<_U1, _T1>,
  1866.     is_convertible<_U2, _T2>>::value>::type>
  1867.  constexpr pair(_U1&& __x, _U2&& __y)
  1868.  : first(std::forward<_U1>(__x)), second(std::forward<_U2>(__y)) { }
  1869.       template<class _U1, class _U2, class = typename
  1870.         enable_if<__and_<is_convertible<_U1, _T1>,
  1871.     is_convertible<_U2, _T2>>::value>::type>
  1872.  constexpr pair(pair<_U1, _U2>&& __p)
  1873.  : first(std::forward<_U1>(__p.first)),
  1874.    second(std::forward<_U2>(__p.second)) { }
  1875.       template<typename... _Args1, typename... _Args2>
  1876.         pair(piecewise_construct_t, tuple<_Args1...>, tuple<_Args2...>);
  1877.       pair&
  1878.       operator=(const pair& __p)
  1879.       {
  1880.  first = __p.first;
  1881.  second = __p.second;
  1882.  return *this;
  1883.       }
  1884.       pair&
  1885.       operator=(pair&& __p)
  1886.       noexcept(__and_<is_nothrow_move_assignable<_T1>,
  1887.                is_nothrow_move_assignable<_T2>>::value)
  1888.       {
  1889.  first = std::forward<first_type>(__p.first);
  1890.  second = std::forward<second_type>(__p.second);
  1891.  return *this;
  1892.       }
  1893.       template<class _U1, class _U2>
  1894.  pair&
  1895.  operator=(const pair<_U1, _U2>& __p)
  1896.  {
  1897.    first = __p.first;
  1898.    second = __p.second;
  1899.    return *this;
  1900.  }
  1901.       template<class _U1, class _U2>
  1902.  pair&
  1903.  operator=(pair<_U1, _U2>&& __p)
  1904.  {
  1905.    first = std::forward<_U1>(__p.first);
  1906.    second = std::forward<_U2>(__p.second);
  1907.    return *this;
  1908.  }
  1909.       void
  1910.       swap(pair& __p)
  1911.       noexcept(noexcept(swap(first, __p.first))
  1912.         && noexcept(swap(second, __p.second)))
  1913.       {
  1914.  using std::swap;
  1915.  swap(first, __p.first);
  1916.  swap(second, __p.second);
  1917.       }
  1918.     private:
  1919.       template<typename... _Args1, std::size_t... _Indexes1,
  1920.                typename... _Args2, std::size_t... _Indexes2>
  1921.         pair(tuple<_Args1...>&, tuple<_Args2...>&,
  1922.              _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
  1923.     };
  1924.   template<class _T1, class _T2>
  1925.     inline constexpr bool
  1926.     operator==(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
  1927.     { return __x.first == __y.first && __x.second == __y.second; }
  1928.   template<class _T1, class _T2>
  1929.     inline constexpr bool
  1930.     operator<(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
  1931.     { return __x.first < __y.first
  1932.       || (!(__y.first < __x.first) && __x.second < __y.second); }
  1933.   template<class _T1, class _T2>
  1934.     inline constexpr bool
  1935.     operator!=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
  1936.     { return !(__x == __y); }
  1937.   template<class _T1, class _T2>
  1938.     inline constexpr bool
  1939.     operator>(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
  1940.     { return __y < __x; }
  1941.   template<class _T1, class _T2>
  1942.     inline constexpr bool
  1943.     operator<=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
  1944.     { return !(__y < __x); }
  1945.   template<class _T1, class _T2>
  1946.     inline constexpr bool
  1947.     operator>=(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y)
  1948.     { return !(__x < __y); }
  1949.   template<class _T1, class _T2>
  1950.     inline void
  1951.     swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
  1952.     noexcept(noexcept(__x.swap(__y)))
  1953.     { __x.swap(__y); }
  1954.   template<class _T1, class _T2>
  1955.     constexpr pair<typename __decay_and_strip<_T1>::__type,
  1956.                    typename __decay_and_strip<_T2>::__type>
  1957.     make_pair(_T1&& __x, _T2&& __y)
  1958.     {
  1959.       typedef typename __decay_and_strip<_T1>::__type __ds_type1;
  1960.       typedef typename __decay_and_strip<_T2>::__type __ds_type2;
  1961.       typedef pair<__ds_type1, __ds_type2> __pair_type;
  1962.       return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
  1963.     }
  1964.  
  1965. }
  1966.        
  1967. namespace std __attribute__ ((__visibility__ ("default")))
  1968. {
  1969.  
  1970.   struct input_iterator_tag { };
  1971.   struct output_iterator_tag { };
  1972.   struct forward_iterator_tag : public input_iterator_tag { };
  1973.   struct bidirectional_iterator_tag : public forward_iterator_tag { };
  1974.   struct random_access_iterator_tag : public bidirectional_iterator_tag { };
  1975.   template<typename _Category, typename _Tp, typename _Distance = ptrdiff_t,
  1976.            typename _Pointer = _Tp*, typename _Reference = _Tp&>
  1977.     struct iterator
  1978.     {
  1979.       typedef _Category iterator_category;
  1980.       typedef _Tp value_type;
  1981.       typedef _Distance difference_type;
  1982.       typedef _Pointer pointer;
  1983.       typedef _Reference reference;
  1984.     };
  1985. template<typename _Tp> class __has_iterator_category_helper : __sfinae_types { template<typename _Up> struct _Wrap_type { }; template<typename _Up> static __one __test(_Wrap_type<typename _Up::iterator_category>*); template<typename _Up> static __two __test(...); public: static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; }; template<typename _Tp> struct __has_iterator_category : integral_constant<bool, __has_iterator_category_helper <typename remove_cv<_Tp>::type>::value> { };
  1986.   template<typename _Iterator,
  1987.     bool = __has_iterator_category<_Iterator>::value>
  1988.     struct __iterator_traits { };
  1989.   template<typename _Iterator>
  1990.     struct __iterator_traits<_Iterator, true>
  1991.     {
  1992.       typedef typename _Iterator::iterator_category iterator_category;
  1993.       typedef typename _Iterator::value_type value_type;
  1994.       typedef typename _Iterator::difference_type difference_type;
  1995.       typedef typename _Iterator::pointer pointer;
  1996.       typedef typename _Iterator::reference reference;
  1997.     };
  1998.   template<typename _Iterator>
  1999.     struct iterator_traits
  2000.     : public __iterator_traits<_Iterator> { };
  2001.   template<typename _Tp>
  2002.     struct iterator_traits<_Tp*>
  2003.     {
  2004.       typedef random_access_iterator_tag iterator_category;
  2005.       typedef _Tp value_type;
  2006.       typedef ptrdiff_t difference_type;
  2007.       typedef _Tp* pointer;
  2008.       typedef _Tp& reference;
  2009.     };
  2010.   template<typename _Tp>
  2011.     struct iterator_traits<const _Tp*>
  2012.     {
  2013.       typedef random_access_iterator_tag iterator_category;
  2014.       typedef _Tp value_type;
  2015.       typedef ptrdiff_t difference_type;
  2016.       typedef const _Tp* pointer;
  2017.       typedef const _Tp& reference;
  2018.     };
  2019.   template<typename _Iter>
  2020.     inline typename iterator_traits<_Iter>::iterator_category
  2021.     __iterator_category(const _Iter&)
  2022.     { return typename iterator_traits<_Iter>::iterator_category(); }
  2023.   template<typename _Iterator, bool _HasBase>
  2024.     struct _Iter_base
  2025.     {
  2026.       typedef _Iterator iterator_type;
  2027.       static iterator_type _S_base(_Iterator __it)
  2028.       { return __it; }
  2029.     };
  2030.   template<typename _Iterator>
  2031.     struct _Iter_base<_Iterator, true>
  2032.     {
  2033.       typedef typename _Iterator::iterator_type iterator_type;
  2034.       static iterator_type _S_base(_Iterator __it)
  2035.       { return __it.base(); }
  2036.     };
  2037.  
  2038. }
  2039.        
  2040. namespace std __attribute__ ((__visibility__ ("default")))
  2041. {
  2042.  
  2043.   template<typename _InputIterator>
  2044.     inline typename iterator_traits<_InputIterator>::difference_type
  2045.     __distance(_InputIterator __first, _InputIterator __last,
  2046.                input_iterator_tag)
  2047.     {
  2048.      
  2049.       typename iterator_traits<_InputIterator>::difference_type __n = 0;
  2050.       while (__first != __last)
  2051.  {
  2052.    ++__first;
  2053.    ++__n;
  2054.  }
  2055.       return __n;
  2056.     }
  2057.   template<typename _RandomAccessIterator>
  2058.     inline typename iterator_traits<_RandomAccessIterator>::difference_type
  2059.     __distance(_RandomAccessIterator __first, _RandomAccessIterator __last,
  2060.                random_access_iterator_tag)
  2061.     {
  2062.      
  2063.       return __last - __first;
  2064.     }
  2065.   template<typename _InputIterator>
  2066.     inline typename iterator_traits<_InputIterator>::difference_type
  2067.     distance(_InputIterator __first, _InputIterator __last)
  2068.     {
  2069.       return std::__distance(__first, __last,
  2070.         std::__iterator_category(__first));
  2071.     }
  2072.   template<typename _InputIterator, typename _Distance>
  2073.     inline void
  2074.     __advance(_InputIterator& __i, _Distance __n, input_iterator_tag)
  2075.     {
  2076.      
  2077.       while (__n--)
  2078.  ++__i;
  2079.     }
  2080.   template<typename _BidirectionalIterator, typename _Distance>
  2081.     inline void
  2082.     __advance(_BidirectionalIterator& __i, _Distance __n,
  2083.        bidirectional_iterator_tag)
  2084.     {
  2085.      
  2086.       if (__n > 0)
  2087.         while (__n--)
  2088.    ++__i;
  2089.       else
  2090.         while (__n++)
  2091.    --__i;
  2092.     }
  2093.   template<typename _RandomAccessIterator, typename _Distance>
  2094.     inline void
  2095.     __advance(_RandomAccessIterator& __i, _Distance __n,
  2096.               random_access_iterator_tag)
  2097.     {
  2098.      
  2099.       __i += __n;
  2100.     }
  2101.   template<typename _InputIterator, typename _Distance>
  2102.     inline void
  2103.     advance(_InputIterator& __i, _Distance __n)
  2104.     {
  2105.       typename iterator_traits<_InputIterator>::difference_type __d = __n;
  2106.       std::__advance(__i, __d, std::__iterator_category(__i));
  2107.     }
  2108.   template<typename _ForwardIterator>
  2109.     inline _ForwardIterator
  2110.     next(_ForwardIterator __x, typename
  2111.   iterator_traits<_ForwardIterator>::difference_type __n = 1)
  2112.     {
  2113.       std::advance(__x, __n);
  2114.       return __x;
  2115.     }
  2116.   template<typename _BidirectionalIterator>
  2117.     inline _BidirectionalIterator
  2118.     prev(_BidirectionalIterator __x, typename
  2119.   iterator_traits<_BidirectionalIterator>::difference_type __n = 1)
  2120.     {
  2121.       std::advance(__x, -__n);
  2122.       return __x;
  2123.     }
  2124.  
  2125. }
  2126. namespace std __attribute__ ((__visibility__ ("default")))
  2127. {
  2128.  
  2129.   template<typename _Iterator>
  2130.     class reverse_iterator
  2131.     : public iterator<typename iterator_traits<_Iterator>::iterator_category,
  2132.         typename iterator_traits<_Iterator>::value_type,
  2133.         typename iterator_traits<_Iterator>::difference_type,
  2134.         typename iterator_traits<_Iterator>::pointer,
  2135.                       typename iterator_traits<_Iterator>::reference>
  2136.     {
  2137.     protected:
  2138.       _Iterator current;
  2139.       typedef iterator_traits<_Iterator> __traits_type;
  2140.     public:
  2141.       typedef _Iterator iterator_type;
  2142.       typedef typename __traits_type::difference_type difference_type;
  2143.       typedef typename __traits_type::pointer pointer;
  2144.       typedef typename __traits_type::reference reference;
  2145.       reverse_iterator() : current() { }
  2146.       explicit
  2147.       reverse_iterator(iterator_type __x) : current(__x) { }
  2148.       reverse_iterator(const reverse_iterator& __x)
  2149.       : current(__x.current) { }
  2150.       template<typename _Iter>
  2151.         reverse_iterator(const reverse_iterator<_Iter>& __x)
  2152.  : current(__x.base()) { }
  2153.       iterator_type
  2154.       base() const
  2155.       { return current; }
  2156.       reference
  2157.       operator*() const
  2158.       {
  2159.  _Iterator __tmp = current;
  2160.  return *--__tmp;
  2161.       }
  2162.       pointer
  2163.       operator->() const
  2164.       { return &(operator*()); }
  2165.       reverse_iterator&
  2166.       operator++()
  2167.       {
  2168.  --current;
  2169.  return *this;
  2170.       }
  2171.       reverse_iterator
  2172.       operator++(int)
  2173.       {
  2174.  reverse_iterator __tmp = *this;
  2175.  --current;
  2176.  return __tmp;
  2177.       }
  2178.       reverse_iterator&
  2179.       operator--()
  2180.       {
  2181.  ++current;
  2182.  return *this;
  2183.       }
  2184.       reverse_iterator
  2185.       operator--(int)
  2186.       {
  2187.  reverse_iterator __tmp = *this;
  2188.  ++current;
  2189.  return __tmp;
  2190.       }
  2191.       reverse_iterator
  2192.       operator+(difference_type __n) const
  2193.       { return reverse_iterator(current - __n); }
  2194.       reverse_iterator&
  2195.       operator+=(difference_type __n)
  2196.       {
  2197.  current -= __n;
  2198.  return *this;
  2199.       }
  2200.       reverse_iterator
  2201.       operator-(difference_type __n) const
  2202.       { return reverse_iterator(current + __n); }
  2203.       reverse_iterator&
  2204.       operator-=(difference_type __n)
  2205.       {
  2206.  current += __n;
  2207.  return *this;
  2208.       }
  2209.       reference
  2210.       operator[](difference_type __n) const
  2211.       { return *(*this + __n); }
  2212.     };
  2213.   template<typename _Iterator>
  2214.     inline bool
  2215.     operator==(const reverse_iterator<_Iterator>& __x,
  2216.         const reverse_iterator<_Iterator>& __y)
  2217.     { return __x.base() == __y.base(); }
  2218.   template<typename _Iterator>
  2219.     inline bool
  2220.     operator<(const reverse_iterator<_Iterator>& __x,
  2221.        const reverse_iterator<_Iterator>& __y)
  2222.     { return __y.base() < __x.base(); }
  2223.   template<typename _Iterator>
  2224.     inline bool
  2225.     operator!=(const reverse_iterator<_Iterator>& __x,
  2226.         const reverse_iterator<_Iterator>& __y)
  2227.     { return !(__x == __y); }
  2228.   template<typename _Iterator>
  2229.     inline bool
  2230.     operator>(const reverse_iterator<_Iterator>& __x,
  2231.        const reverse_iterator<_Iterator>& __y)
  2232.     { return __y < __x; }
  2233.   template<typename _Iterator>
  2234.     inline bool
  2235.     operator<=(const reverse_iterator<_Iterator>& __x,
  2236.         const reverse_iterator<_Iterator>& __y)
  2237.     { return !(__y < __x); }
  2238.   template<typename _Iterator>
  2239.     inline bool
  2240.     operator>=(const reverse_iterator<_Iterator>& __x,
  2241.         const reverse_iterator<_Iterator>& __y)
  2242.     { return !(__x < __y); }
  2243.   template<typename _Iterator>
  2244.     inline typename reverse_iterator<_Iterator>::difference_type
  2245.     operator-(const reverse_iterator<_Iterator>& __x,
  2246.        const reverse_iterator<_Iterator>& __y)
  2247.     { return __y.base() - __x.base(); }
  2248.   template<typename _Iterator>
  2249.     inline reverse_iterator<_Iterator>
  2250.     operator+(typename reverse_iterator<_Iterator>::difference_type __n,
  2251.        const reverse_iterator<_Iterator>& __x)
  2252.     { return reverse_iterator<_Iterator>(__x.base() - __n); }
  2253.   template<typename _IteratorL, typename _IteratorR>
  2254.     inline bool
  2255.     operator==(const reverse_iterator<_IteratorL>& __x,
  2256.         const reverse_iterator<_IteratorR>& __y)
  2257.     { return __x.base() == __y.base(); }
  2258.   template<typename _IteratorL, typename _IteratorR>
  2259.     inline bool
  2260.     operator<(const reverse_iterator<_IteratorL>& __x,
  2261.        const reverse_iterator<_IteratorR>& __y)
  2262.     { return __y.base() < __x.base(); }
  2263.   template<typename _IteratorL, typename _IteratorR>
  2264.     inline bool
  2265.     operator!=(const reverse_iterator<_IteratorL>& __x,
  2266.         const reverse_iterator<_IteratorR>& __y)
  2267.     { return !(__x == __y); }
  2268.   template<typename _IteratorL, typename _IteratorR>
  2269.     inline bool
  2270.     operator>(const reverse_iterator<_IteratorL>& __x,
  2271.        const reverse_iterator<_IteratorR>& __y)
  2272.     { return __y < __x; }
  2273.   template<typename _IteratorL, typename _IteratorR>
  2274.     inline bool
  2275.     operator<=(const reverse_iterator<_IteratorL>& __x,
  2276.         const reverse_iterator<_IteratorR>& __y)
  2277.     { return !(__y < __x); }
  2278.   template<typename _IteratorL, typename _IteratorR>
  2279.     inline bool
  2280.     operator>=(const reverse_iterator<_IteratorL>& __x,
  2281.         const reverse_iterator<_IteratorR>& __y)
  2282.     { return !(__x < __y); }
  2283.   template<typename _IteratorL, typename _IteratorR>
  2284.     inline auto
  2285.     operator-(const reverse_iterator<_IteratorL>& __x,
  2286.        const reverse_iterator<_IteratorR>& __y)
  2287.     -> decltype(__y.base() - __x.base())
  2288.     { return __y.base() - __x.base(); }
  2289.   template<typename _Container>
  2290.     class back_insert_iterator
  2291.     : public iterator<output_iterator_tag, void, void, void, void>
  2292.     {
  2293.     protected:
  2294.       _Container* container;
  2295.     public:
  2296.       typedef _Container container_type;
  2297.       explicit
  2298.       back_insert_iterator(_Container& __x) : container(&__x) { }
  2299.       back_insert_iterator&
  2300.       operator=(const typename _Container::value_type& __value)
  2301.       {
  2302.  container->push_back(__value);
  2303.  return *this;
  2304.       }
  2305.       back_insert_iterator&
  2306.       operator=(typename _Container::value_type&& __value)
  2307.       {
  2308.  container->push_back(std::move(__value));
  2309.  return *this;
  2310.       }
  2311.       back_insert_iterator&
  2312.       operator*()
  2313.       { return *this; }
  2314.       back_insert_iterator&
  2315.       operator++()
  2316.       { return *this; }
  2317.       back_insert_iterator
  2318.       operator++(int)
  2319.       { return *this; }
  2320.     };
  2321.   template<typename _Container>
  2322.     inline back_insert_iterator<_Container>
  2323.     back_inserter(_Container& __x)
  2324.     { return back_insert_iterator<_Container>(__x); }
  2325.   template<typename _Container>
  2326.     class front_insert_iterator
  2327.     : public iterator<output_iterator_tag, void, void, void, void>
  2328.     {
  2329.     protected:
  2330.       _Container* container;
  2331.     public:
  2332.       typedef _Container container_type;
  2333.       explicit front_insert_iterator(_Container& __x) : container(&__x) { }
  2334.       front_insert_iterator&
  2335.       operator=(const typename _Container::value_type& __value)
  2336.       {
  2337.  container->push_front(__value);
  2338.  return *this;
  2339.       }
  2340.       front_insert_iterator&
  2341.       operator=(typename _Container::value_type&& __value)
  2342.       {
  2343.  container->push_front(std::move(__value));
  2344.  return *this;
  2345.       }
  2346.       front_insert_iterator&
  2347.       operator*()
  2348.       { return *this; }
  2349.       front_insert_iterator&
  2350.       operator++()
  2351.       { return *this; }
  2352.       front_insert_iterator
  2353.       operator++(int)
  2354.       { return *this; }
  2355.     };
  2356.   template<typename _Container>
  2357.     inline front_insert_iterator<_Container>
  2358.     front_inserter(_Container& __x)
  2359.     { return front_insert_iterator<_Container>(__x); }
  2360.   template<typename _Container>
  2361.     class insert_iterator
  2362.     : public iterator<output_iterator_tag, void, void, void, void>
  2363.     {
  2364.     protected:
  2365.       _Container* container;
  2366.       typename _Container::iterator iter;
  2367.     public:
  2368.       typedef _Container container_type;
  2369.       insert_iterator(_Container& __x, typename _Container::iterator __i)
  2370.       : container(&__x), iter(__i) {}
  2371.       insert_iterator&
  2372.       operator=(const typename _Container::value_type& __value)
  2373.       {
  2374.  iter = container->insert(iter, __value);
  2375.  ++iter;
  2376.  return *this;
  2377.       }
  2378.       insert_iterator&
  2379.       operator=(typename _Container::value_type&& __value)
  2380.       {
  2381.  iter = container->insert(iter, std::move(__value));
  2382.  ++iter;
  2383.  return *this;
  2384.       }
  2385.       insert_iterator&
  2386.       operator*()
  2387.       { return *this; }
  2388.       insert_iterator&
  2389.       operator++()
  2390.       { return *this; }
  2391.       insert_iterator&
  2392.       operator++(int)
  2393.       { return *this; }
  2394.     };
  2395.   template<typename _Container, typename _Iterator>
  2396.     inline insert_iterator<_Container>
  2397.     inserter(_Container& __x, _Iterator __i)
  2398.     {
  2399.       return insert_iterator<_Container>(__x,
  2400.       typename _Container::iterator(__i));
  2401.     }
  2402.  
  2403. }
  2404. namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
  2405. {
  2406.  
  2407.   using std::iterator_traits;
  2408.   using std::iterator;
  2409.   template<typename _Iterator, typename _Container>
  2410.     class __normal_iterator
  2411.     {
  2412.     protected:
  2413.       _Iterator _M_current;
  2414.       typedef iterator_traits<_Iterator> __traits_type;
  2415.     public:
  2416.       typedef _Iterator iterator_type;
  2417.       typedef typename __traits_type::iterator_category iterator_category;
  2418.       typedef typename __traits_type::value_type value_type;
  2419.       typedef typename __traits_type::difference_type difference_type;
  2420.       typedef typename __traits_type::reference reference;
  2421.       typedef typename __traits_type::pointer pointer;
  2422.       constexpr __normal_iterator() : _M_current(_Iterator()) { }
  2423.       explicit
  2424.       __normal_iterator(const _Iterator& __i) : _M_current(__i) { }
  2425.       template<typename _Iter>
  2426.         __normal_iterator(const __normal_iterator<_Iter,
  2427.      typename __enable_if<
  2428.               (std::__are_same<_Iter, typename _Container::pointer>::__value),
  2429.         _Container>::__type>& __i)
  2430.         : _M_current(__i.base()) { }
  2431.       reference
  2432.       operator*() const
  2433.       { return *_M_current; }
  2434.       pointer
  2435.       operator->() const
  2436.       { return _M_current; }
  2437.       __normal_iterator&
  2438.       operator++()
  2439.       {
  2440.  ++_M_current;
  2441.  return *this;
  2442.       }
  2443.       __normal_iterator
  2444.       operator++(int)
  2445.       { return __normal_iterator(_M_current++); }
  2446.       __normal_iterator&
  2447.       operator--()
  2448.       {
  2449.  --_M_current;
  2450.  return *this;
  2451.       }
  2452.       __normal_iterator
  2453.       operator--(int)
  2454.       { return __normal_iterator(_M_current--); }
  2455.       reference
  2456.       operator[](const difference_type& __n) const
  2457.       { return _M_current[__n]; }
  2458.       __normal_iterator&
  2459.       operator+=(const difference_type& __n)
  2460.       { _M_current += __n; return *this; }
  2461.       __normal_iterator
  2462.       operator+(const difference_type& __n) const
  2463.       { return __normal_iterator(_M_current + __n); }
  2464.       __normal_iterator&
  2465.       operator-=(const difference_type& __n)
  2466.       { _M_current -= __n; return *this; }
  2467.       __normal_iterator
  2468.       operator-(const difference_type& __n) const
  2469.       { return __normal_iterator(_M_current - __n); }
  2470.       const _Iterator&
  2471.       base() const
  2472.       { return _M_current; }
  2473.     };
  2474.   template<typename _IteratorL, typename _IteratorR, typename _Container>
  2475.     inline bool
  2476.     operator==(const __normal_iterator<_IteratorL, _Container>& __lhs,
  2477.         const __normal_iterator<_IteratorR, _Container>& __rhs)
  2478.     { return __lhs.base() == __rhs.base(); }
  2479.   template<typename _Iterator, typename _Container>
  2480.     inline bool
  2481.     operator==(const __normal_iterator<_Iterator, _Container>& __lhs,
  2482.         const __normal_iterator<_Iterator, _Container>& __rhs)
  2483.     { return __lhs.base() == __rhs.base(); }
  2484.   template<typename _IteratorL, typename _IteratorR, typename _Container>
  2485.     inline bool
  2486.     operator!=(const __normal_iterator<_IteratorL, _Container>& __lhs,
  2487.         const __normal_iterator<_IteratorR, _Container>& __rhs)
  2488.     { return __lhs.base() != __rhs.base(); }
  2489.   template<typename _Iterator, typename _Container>
  2490.     inline bool
  2491.     operator!=(const __normal_iterator<_Iterator, _Container>& __lhs,
  2492.         const __normal_iterator<_Iterator, _Container>& __rhs)
  2493.     { return __lhs.base() != __rhs.base(); }
  2494.   template<typename _IteratorL, typename _IteratorR, typename _Container>
  2495.     inline bool
  2496.     operator<(const __normal_iterator<_IteratorL, _Container>& __lhs,
  2497.        const __normal_iterator<_IteratorR, _Container>& __rhs)
  2498.     { return __lhs.base() < __rhs.base(); }
  2499.   template<typename _Iterator, typename _Container>
  2500.     inline bool
  2501.     operator<(const __normal_iterator<_Iterator, _Container>& __lhs,
  2502.        const __normal_iterator<_Iterator, _Container>& __rhs)
  2503.     { return __lhs.base() < __rhs.base(); }
  2504.   template<typename _IteratorL, typename _IteratorR, typename _Container>
  2505.     inline bool
  2506.     operator>(const __normal_iterator<_IteratorL, _Container>& __lhs,
  2507.        const __normal_iterator<_IteratorR, _Container>& __rhs)
  2508.     { return __lhs.base() > __rhs.base(); }
  2509.   template<typename _Iterator, typename _Container>
  2510.     inline bool
  2511.     operator>(const __normal_iterator<_Iterator, _Container>& __lhs,
  2512.        const __normal_iterator<_Iterator, _Container>& __rhs)
  2513.     { return __lhs.base() > __rhs.base(); }
  2514.   template<typename _IteratorL, typename _IteratorR, typename _Container>
  2515.     inline bool
  2516.     operator<=(const __normal_iterator<_IteratorL, _Container>& __lhs,
  2517.         const __normal_iterator<_IteratorR, _Container>& __rhs)
  2518.     { return __lhs.base() <= __rhs.base(); }
  2519.   template<typename _Iterator, typename _Container>
  2520.     inline bool
  2521.     operator<=(const __normal_iterator<_Iterator, _Container>& __lhs,
  2522.         const __normal_iterator<_Iterator, _Container>& __rhs)
  2523.     { return __lhs.base() <= __rhs.base(); }
  2524.   template<typename _IteratorL, typename _IteratorR, typename _Container>
  2525.     inline bool
  2526.     operator>=(const __normal_iterator<_IteratorL, _Container>& __lhs,
  2527.         const __normal_iterator<_IteratorR, _Container>& __rhs)
  2528.     { return __lhs.base() >= __rhs.base(); }
  2529.   template<typename _Iterator, typename _Container>
  2530.     inline bool
  2531.     operator>=(const __normal_iterator<_Iterator, _Container>& __lhs,
  2532.         const __normal_iterator<_Iterator, _Container>& __rhs)
  2533.     { return __lhs.base() >= __rhs.base(); }
  2534.   template<typename _IteratorL, typename _IteratorR, typename _Container>
  2535.     inline auto
  2536.     operator-(const __normal_iterator<_IteratorL, _Container>& __lhs,
  2537.        const __normal_iterator<_IteratorR, _Container>& __rhs)
  2538.     -> decltype(__lhs.base() - __rhs.base())
  2539.     { return __lhs.base() - __rhs.base(); }
  2540.   template<typename _Iterator, typename _Container>
  2541.     inline typename __normal_iterator<_Iterator, _Container>::difference_type
  2542.     operator-(const __normal_iterator<_Iterator, _Container>& __lhs,
  2543.        const __normal_iterator<_Iterator, _Container>& __rhs)
  2544.     { return __lhs.base() - __rhs.base(); }
  2545.   template<typename _Iterator, typename _Container>
  2546.     inline __normal_iterator<_Iterator, _Container>
  2547.     operator+(typename __normal_iterator<_Iterator, _Container>::difference_type
  2548.        __n, const __normal_iterator<_Iterator, _Container>& __i)
  2549.     { return __normal_iterator<_Iterator, _Container>(__i.base() + __n); }
  2550.  
  2551. }
  2552. namespace std __attribute__ ((__visibility__ ("default")))
  2553. {
  2554.  
  2555.   template<typename _Iterator>
  2556.     class move_iterator
  2557.     {
  2558.     protected:
  2559.       _Iterator _M_current;
  2560.       typedef iterator_traits<_Iterator> __traits_type;
  2561.     public:
  2562.       typedef _Iterator iterator_type;
  2563.       typedef typename __traits_type::iterator_category iterator_category;
  2564.       typedef typename __traits_type::value_type value_type;
  2565.       typedef typename __traits_type::difference_type difference_type;
  2566.       typedef _Iterator pointer;
  2567.       typedef value_type&& reference;
  2568.       move_iterator()
  2569.       : _M_current() { }
  2570.       explicit
  2571.       move_iterator(iterator_type __i)
  2572.       : _M_current(__i) { }
  2573.       template<typename _Iter>
  2574.  move_iterator(const move_iterator<_Iter>& __i)
  2575.  : _M_current(__i.base()) { }
  2576.       iterator_type
  2577.       base() const
  2578.       { return _M_current; }
  2579.       reference
  2580.       operator*() const
  2581.       { return std::move(*_M_current); }
  2582.       pointer
  2583.       operator->() const
  2584.       { return _M_current; }
  2585.       move_iterator&
  2586.       operator++()
  2587.       {
  2588.  ++_M_current;
  2589.  return *this;
  2590.       }
  2591.       move_iterator
  2592.       operator++(int)
  2593.       {
  2594.  move_iterator __tmp = *this;
  2595.  ++_M_current;
  2596.  return __tmp;
  2597.       }
  2598.       move_iterator&
  2599.       operator--()
  2600.       {
  2601.  --_M_current;
  2602.  return *this;
  2603.       }
  2604.       move_iterator
  2605.       operator--(int)
  2606.       {
  2607.  move_iterator __tmp = *this;
  2608.  --_M_current;
  2609.  return __tmp;
  2610.       }
  2611.       move_iterator
  2612.       operator+(difference_type __n) const
  2613.       { return move_iterator(_M_current + __n); }
  2614.       move_iterator&
  2615.       operator+=(difference_type __n)
  2616.       {
  2617.  _M_current += __n;
  2618.  return *this;
  2619.       }
  2620.       move_iterator
  2621.       operator-(difference_type __n) const
  2622.       { return move_iterator(_M_current - __n); }
  2623.       move_iterator&
  2624.       operator-=(difference_type __n)
  2625.       {
  2626.  _M_current -= __n;
  2627.  return *this;
  2628.       }
  2629.       reference
  2630.       operator[](difference_type __n) const
  2631.       { return std::move(_M_current[__n]); }
  2632.     };
  2633.   template<typename _IteratorL, typename _IteratorR>
  2634.     inline bool
  2635.     operator==(const move_iterator<_IteratorL>& __x,
  2636.         const move_iterator<_IteratorR>& __y)
  2637.     { return __x.base() == __y.base(); }
  2638.   template<typename _Iterator>
  2639.     inline bool
  2640.     operator==(const move_iterator<_Iterator>& __x,
  2641.         const move_iterator<_Iterator>& __y)
  2642.     { return __x.base() == __y.base(); }
  2643.   template<typename _IteratorL, typename _IteratorR>
  2644.     inline bool
  2645.     operator!=(const move_iterator<_IteratorL>& __x,
  2646.         const move_iterator<_IteratorR>& __y)
  2647.     { return !(__x == __y); }
  2648.   template<typename _Iterator>
  2649.     inline bool
  2650.     operator!=(const move_iterator<_Iterator>& __x,
  2651.         const move_iterator<_Iterator>& __y)
  2652.     { return !(__x == __y); }
  2653.   template<typename _IteratorL, typename _IteratorR>
  2654.     inline bool
  2655.     operator<(const move_iterator<_IteratorL>& __x,
  2656.        const move_iterator<_IteratorR>& __y)
  2657.     { return __x.base() < __y.base(); }
  2658.   template<typename _Iterator>
  2659.     inline bool
  2660.     operator<(const move_iterator<_Iterator>& __x,
  2661.        const move_iterator<_Iterator>& __y)
  2662.     { return __x.base() < __y.base(); }
  2663.   template<typename _IteratorL, typename _IteratorR>
  2664.     inline bool
  2665.     operator<=(const move_iterator<_IteratorL>& __x,
  2666.         const move_iterator<_IteratorR>& __y)
  2667.     { return !(__y < __x); }
  2668.   template<typename _Iterator>
  2669.     inline bool
  2670.     operator<=(const move_iterator<_Iterator>& __x,
  2671.         const move_iterator<_Iterator>& __y)
  2672.     { return !(__y < __x); }
  2673.   template<typename _IteratorL, typename _IteratorR>
  2674.     inline bool
  2675.     operator>(const move_iterator<_IteratorL>& __x,
  2676.        const move_iterator<_IteratorR>& __y)
  2677.     { return __y < __x; }
  2678.   template<typename _Iterator>
  2679.     inline bool
  2680.     operator>(const move_iterator<_Iterator>& __x,
  2681.        const move_iterator<_Iterator>& __y)
  2682.     { return __y < __x; }
  2683.   template<typename _IteratorL, typename _IteratorR>
  2684.     inline bool
  2685.     operator>=(const move_iterator<_IteratorL>& __x,
  2686.         const move_iterator<_IteratorR>& __y)
  2687.     { return !(__x < __y); }
  2688.   template<typename _Iterator>
  2689.     inline bool
  2690.     operator>=(const move_iterator<_Iterator>& __x,
  2691.         const move_iterator<_Iterator>& __y)
  2692.     { return !(__x < __y); }
  2693.   template<typename _IteratorL, typename _IteratorR>
  2694.     inline auto
  2695.     operator-(const move_iterator<_IteratorL>& __x,
  2696.        const move_iterator<_IteratorR>& __y)
  2697.     -> decltype(__x.base() - __y.base())
  2698.     { return __x.base() - __y.base(); }
  2699.   template<typename _Iterator>
  2700.     inline auto
  2701.     operator-(const move_iterator<_Iterator>& __x,
  2702.        const move_iterator<_Iterator>& __y)
  2703.     -> decltype(__x.base() - __y.base())
  2704.     { return __x.base() - __y.base(); }
  2705.   template<typename _Iterator>
  2706.     inline move_iterator<_Iterator>
  2707.     operator+(typename move_iterator<_Iterator>::difference_type __n,
  2708.        const move_iterator<_Iterator>& __x)
  2709.     { return __x + __n; }
  2710.   template<typename _Iterator>
  2711.     inline move_iterator<_Iterator>
  2712.     make_move_iterator(_Iterator __i)
  2713.     { return move_iterator<_Iterator>(__i); }
  2714.   template<typename _Iterator, typename _ReturnType
  2715.     = typename conditional<__move_if_noexcept_cond
  2716.       <typename iterator_traits<_Iterator>::value_type>::value,
  2717.                 _Iterator, move_iterator<_Iterator>>::type>
  2718.     inline _ReturnType
  2719.     __make_move_if_noexcept_iterator(_Iterator __i)
  2720.     { return _ReturnType(__i); }
  2721.  
  2722. }
  2723. namespace std
  2724. {
  2725.   namespace __debug { }
  2726. }
  2727. namespace __gnu_debug
  2728. {
  2729.   using namespace std::__debug;
  2730. }
  2731. namespace std __attribute__ ((__visibility__ ("default")))
  2732. {
  2733.  
  2734.   template<bool _BoolType>
  2735.     struct __iter_swap
  2736.     {
  2737.       template<typename _ForwardIterator1, typename _ForwardIterator2>
  2738.         static void
  2739.         iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
  2740.         {
  2741.           typedef typename iterator_traits<_ForwardIterator1>::value_type
  2742.             _ValueType1;
  2743.           _ValueType1 __tmp = std::move(*__a);
  2744.           *__a = std::move(*__b);
  2745.           *__b = std::move(__tmp);
  2746.  }
  2747.     };
  2748.   template<>
  2749.     struct __iter_swap<true>
  2750.     {
  2751.       template<typename _ForwardIterator1, typename _ForwardIterator2>
  2752.         static void
  2753.         iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
  2754.         {
  2755.           swap(*__a, *__b);
  2756.         }
  2757.     };
  2758.   template<typename _ForwardIterator1, typename _ForwardIterator2>
  2759.     inline void
  2760.     iter_swap(_ForwardIterator1 __a, _ForwardIterator2 __b)
  2761.     {
  2762.       typedef typename iterator_traits<_ForwardIterator1>::value_type
  2763.  _ValueType1;
  2764.       typedef typename iterator_traits<_ForwardIterator2>::value_type
  2765.  _ValueType2;
  2766.      
  2767.      
  2768.      
  2769.      
  2770.       typedef typename iterator_traits<_ForwardIterator1>::reference
  2771.  _ReferenceType1;
  2772.       typedef typename iterator_traits<_ForwardIterator2>::reference
  2773.  _ReferenceType2;
  2774.       std::__iter_swap<__are_same<_ValueType1, _ValueType2>::__value
  2775.  && __are_same<_ValueType1&, _ReferenceType1>::__value
  2776.  && __are_same<_ValueType2&, _ReferenceType2>::__value>::
  2777.  iter_swap(__a, __b);
  2778.     }
  2779.   template<typename _ForwardIterator1, typename _ForwardIterator2>
  2780.     _ForwardIterator2
  2781.     swap_ranges(_ForwardIterator1 __first1, _ForwardIterator1 __last1,
  2782.   _ForwardIterator2 __first2)
  2783.     {
  2784.      
  2785.      
  2786.       ;
  2787.       for (; __first1 != __last1; ++__first1, ++__first2)
  2788.  std::iter_swap(__first1, __first2);
  2789.       return __first2;
  2790.     }
  2791.   template<typename _Tp>
  2792.     inline const _Tp&
  2793.     min(const _Tp& __a, const _Tp& __b)
  2794.     {
  2795.      
  2796.       if (__b < __a)
  2797.  return __b;
  2798.       return __a;
  2799.     }
  2800.   template<typename _Tp>
  2801.     inline const _Tp&
  2802.     max(const _Tp& __a, const _Tp& __b)
  2803.     {
  2804.      
  2805.       if (__a < __b)
  2806.  return __b;
  2807.       return __a;
  2808.     }
  2809.   template<typename _Tp, typename _Compare>
  2810.     inline const _Tp&
  2811.     min(const _Tp& __a, const _Tp& __b, _Compare __comp)
  2812.     {
  2813.       if (__comp(__b, __a))
  2814.  return __b;
  2815.       return __a;
  2816.     }
  2817.   template<typename _Tp, typename _Compare>
  2818.     inline const _Tp&
  2819.     max(const _Tp& __a, const _Tp& __b, _Compare __comp)
  2820.     {
  2821.       if (__comp(__a, __b))
  2822.  return __b;
  2823.       return __a;
  2824.     }
  2825.   template<typename _Iterator>
  2826.     struct _Niter_base
  2827.     : _Iter_base<_Iterator, __is_normal_iterator<_Iterator>::__value>
  2828.     { };
  2829.   template<typename _Iterator>
  2830.     inline typename _Niter_base<_Iterator>::iterator_type
  2831.     __niter_base(_Iterator __it)
  2832.     { return std::_Niter_base<_Iterator>::_S_base(__it); }
  2833.   template<typename _Iterator>
  2834.     struct _Miter_base
  2835.     : _Iter_base<_Iterator, __is_move_iterator<_Iterator>::__value>
  2836.     { };
  2837.   template<typename _Iterator>
  2838.     inline typename _Miter_base<_Iterator>::iterator_type
  2839.     __miter_base(_Iterator __it)
  2840.     { return std::_Miter_base<_Iterator>::_S_base(__it); }
  2841.   template<bool, bool, typename>
  2842.     struct __copy_move
  2843.     {
  2844.       template<typename _II, typename _OI>
  2845.         static _OI
  2846.         __copy_m(_II __first, _II __last, _OI __result)
  2847.         {
  2848.    for (; __first != __last; ++__result, ++__first)
  2849.      *__result = *__first;
  2850.    return __result;
  2851.  }
  2852.     };
  2853.   template<typename _Category>
  2854.     struct __copy_move<true, false, _Category>
  2855.     {
  2856.       template<typename _II, typename _OI>
  2857.         static _OI
  2858.         __copy_m(_II __first, _II __last, _OI __result)
  2859.         {
  2860.    for (; __first != __last; ++__result, ++__first)
  2861.      *__result = std::move(*__first);
  2862.    return __result;
  2863.  }
  2864.     };
  2865.   template<>
  2866.     struct __copy_move<false, false, random_access_iterator_tag>
  2867.     {
  2868.       template<typename _II, typename _OI>
  2869.         static _OI
  2870.         __copy_m(_II __first, _II __last, _OI __result)
  2871.         {
  2872.    typedef typename iterator_traits<_II>::difference_type _Distance;
  2873.    for(_Distance __n = __last - __first; __n > 0; --__n)
  2874.      {
  2875.        *__result = *__first;
  2876.        ++__first;
  2877.        ++__result;
  2878.      }
  2879.    return __result;
  2880.  }
  2881.     };
  2882.   template<>
  2883.     struct __copy_move<true, false, random_access_iterator_tag>
  2884.     {
  2885.       template<typename _II, typename _OI>
  2886.         static _OI
  2887.         __copy_m(_II __first, _II __last, _OI __result)
  2888.         {
  2889.    typedef typename iterator_traits<_II>::difference_type _Distance;
  2890.    for(_Distance __n = __last - __first; __n > 0; --__n)
  2891.      {
  2892.        *__result = std::move(*__first);
  2893.        ++__first;
  2894.        ++__result;
  2895.      }
  2896.    return __result;
  2897.  }
  2898.     };
  2899.   template<bool _IsMove>
  2900.     struct __copy_move<_IsMove, true, random_access_iterator_tag>
  2901.     {
  2902.       template<typename _Tp>
  2903.         static _Tp*
  2904.         __copy_m(const _Tp* __first, const _Tp* __last, _Tp* __result)
  2905.         {
  2906.    const ptrdiff_t _Num = __last - __first;
  2907.    if (_Num)
  2908.      __builtin_memmove(__result, __first, sizeof(_Tp) * _Num);
  2909.    return __result + _Num;
  2910.  }
  2911.     };
  2912.   template<bool _IsMove, typename _II, typename _OI>
  2913.     inline _OI
  2914.     __copy_move_a(_II __first, _II __last, _OI __result)
  2915.     {
  2916.       typedef typename iterator_traits<_II>::value_type _ValueTypeI;
  2917.       typedef typename iterator_traits<_OI>::value_type _ValueTypeO;
  2918.       typedef typename iterator_traits<_II>::iterator_category _Category;
  2919.       const bool __simple = (__is_trivial(_ValueTypeI)
  2920.                       && __is_pointer<_II>::__value
  2921.                       && __is_pointer<_OI>::__value
  2922.         && __are_same<_ValueTypeI, _ValueTypeO>::__value);
  2923.       return std::__copy_move<_IsMove, __simple,
  2924.                        _Category>::__copy_m(__first, __last, __result);
  2925.     }
  2926.   template<typename _CharT>
  2927.     struct char_traits;
  2928.   template<typename _CharT, typename _Traits>
  2929.     class istreambuf_iterator;
  2930.   template<typename _CharT, typename _Traits>
  2931.     class ostreambuf_iterator;
  2932.   template<bool _IsMove, typename _CharT>
  2933.     typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
  2934.       ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
  2935.     __copy_move_a2(_CharT*, _CharT*,
  2936.      ostreambuf_iterator<_CharT, char_traits<_CharT> >);
  2937.   template<bool _IsMove, typename _CharT>
  2938.     typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
  2939.       ostreambuf_iterator<_CharT, char_traits<_CharT> > >::__type
  2940.     __copy_move_a2(const _CharT*, const _CharT*,
  2941.      ostreambuf_iterator<_CharT, char_traits<_CharT> >);
  2942.   template<bool _IsMove, typename _CharT>
  2943.     typename __gnu_cxx::__enable_if<__is_char<_CharT>::__value,
  2944.         _CharT*>::__type
  2945.     __copy_move_a2(istreambuf_iterator<_CharT, char_traits<_CharT> >,
  2946.      istreambuf_iterator<_CharT, char_traits<_CharT> >, _CharT*);
  2947.   template<bool _IsMove, typename _II, typename _OI>
  2948.     inline _OI
  2949.     __copy_move_a2(_II __first, _II __last, _OI __result)
  2950.     {
  2951.       return _OI(std::__copy_move_a<_IsMove>(std::__niter_base(__first),
  2952.           std::__niter_base(__last),
  2953.           std::__niter_base(__result)));
  2954.     }
  2955.   template<typename _II, typename _OI>
  2956.     inline _OI
  2957.     copy(_II __first, _II __last, _OI __result)
  2958.     {
  2959.      
  2960.      
  2961.       ;
  2962.       return (std::__copy_move_a2<__is_move_iterator<_II>::__value>
  2963.        (std::__miter_base(__first), std::__miter_base(__last),
  2964.         __result));
  2965.     }
  2966.   template<typename _II, typename _OI>
  2967.     inline _OI
  2968.     move(_II __first, _II __last, _OI __result)
  2969.     {
  2970.      
  2971.      
  2972.       ;
  2973.       return std::__copy_move_a2<true>(std::__miter_base(__first),
  2974.            std::__miter_base(__last), __result);
  2975.     }
  2976.   template<bool, bool, typename>
  2977.     struct __copy_move_backward
  2978.     {
  2979.       template<typename _BI1, typename _BI2>
  2980.         static _BI2
  2981.         __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
  2982.         {
  2983.    while (__first != __last)
  2984.      *--__result = *--__last;
  2985.    return __result;
  2986.  }
  2987.     };
  2988.   template<typename _Category>
  2989.     struct __copy_move_backward<true, false, _Category>
  2990.     {
  2991.       template<typename _BI1, typename _BI2>
  2992.         static _BI2
  2993.         __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
  2994.         {
  2995.    while (__first != __last)
  2996.      *--__result = std::move(*--__last);
  2997.    return __result;
  2998.  }
  2999.     };
  3000.   template<>
  3001.     struct __copy_move_backward<false, false, random_access_iterator_tag>
  3002.     {
  3003.       template<typename _BI1, typename _BI2>
  3004.         static _BI2
  3005.         __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
  3006.         {
  3007.    typename iterator_traits<_BI1>::difference_type __n;
  3008.    for (__n = __last - __first; __n > 0; --__n)
  3009.      *--__result = *--__last;
  3010.    return __result;
  3011.  }
  3012.     };
  3013.   template<>
  3014.     struct __copy_move_backward<true, false, random_access_iterator_tag>
  3015.     {
  3016.       template<typename _BI1, typename _BI2>
  3017.         static _BI2
  3018.         __copy_move_b(_BI1 __first, _BI1 __last, _BI2 __result)
  3019.         {
  3020.    typename iterator_traits<_BI1>::difference_type __n;
  3021.    for (__n = __last - __first; __n > 0; --__n)
  3022.      *--__result = std::move(*--__last);
  3023.    return __result;
  3024.  }
  3025.     };
  3026.   template<bool _IsMove>
  3027.     struct __copy_move_backward<_IsMove, true, random_access_iterator_tag>
  3028.     {
  3029.       template<typename _Tp>
  3030.         static _Tp*
  3031.         __copy_move_b(const _Tp* __first, const _Tp* __last, _Tp* __result)
  3032.         {
  3033.    const ptrdiff_t _Num = __last - __first;
  3034.    if (_Num)
  3035.      __builtin_memmove(__result - _Num, __first, sizeof(_Tp) * _Num);
  3036.    return __result - _Num;
  3037.  }
  3038.     };
  3039.   template<bool _IsMove, typename _BI1, typename _BI2>
  3040.     inline _BI2
  3041.     __copy_move_backward_a(_BI1 __first, _BI1 __last, _BI2 __result)
  3042.     {
  3043.       typedef typename iterator_traits<_BI1>::value_type _ValueType1;
  3044.       typedef typename iterator_traits<_BI2>::value_type _ValueType2;
  3045.       typedef typename iterator_traits<_BI1>::iterator_category _Category;
  3046.       const bool __simple = (__is_trivial(_ValueType1)
  3047.                       && __is_pointer<_BI1>::__value
  3048.                       && __is_pointer<_BI2>::__value
  3049.         && __are_same<_ValueType1, _ValueType2>::__value);
  3050.       return std::__copy_move_backward<_IsMove, __simple,
  3051.                                 _Category>::__copy_move_b(__first,
  3052.          __last,
  3053.          __result);
  3054.     }
  3055.   template<bool _IsMove, typename _BI1, typename _BI2>
  3056.     inline _BI2
  3057.     __copy_move_backward_a2(_BI1 __first, _BI1 __last, _BI2 __result)
  3058.     {
  3059.       return _BI2(std::__copy_move_backward_a<_IsMove>
  3060.     (std::__niter_base(__first), std::__niter_base(__last),
  3061.      std::__niter_base(__result)));
  3062.     }
  3063.   template<typename _BI1, typename _BI2>
  3064.     inline _BI2
  3065.     copy_backward(_BI1 __first, _BI1 __last, _BI2 __result)
  3066.     {
  3067.      
  3068.      
  3069.      
  3070.       ;
  3071.       return (std::__copy_move_backward_a2<__is_move_iterator<_BI1>::__value>
  3072.        (std::__miter_base(__first), std::__miter_base(__last),
  3073.         __result));
  3074.     }
  3075.   template<typename _BI1, typename _BI2>
  3076.     inline _BI2
  3077.     move_backward(_BI1 __first, _BI1 __last, _BI2 __result)
  3078.     {
  3079.      
  3080.      
  3081.      
  3082.       ;
  3083.       return std::__copy_move_backward_a2<true>(std::__miter_base(__first),
  3084.       std::__miter_base(__last),
  3085.       __result);
  3086.     }
  3087.   template<typename _ForwardIterator, typename _Tp>
  3088.     inline typename
  3089.     __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, void>::__type
  3090.     __fill_a(_ForwardIterator __first, _ForwardIterator __last,
  3091.        const _Tp& __value)
  3092.     {
  3093.       for (; __first != __last; ++__first)
  3094.  *__first = __value;
  3095.     }
  3096.   template<typename _ForwardIterator, typename _Tp>
  3097.     inline typename
  3098.     __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, void>::__type
  3099.     __fill_a(_ForwardIterator __first, _ForwardIterator __last,
  3100.       const _Tp& __value)
  3101.     {
  3102.       const _Tp __tmp = __value;
  3103.       for (; __first != __last; ++__first)
  3104.  *__first = __tmp;
  3105.     }
  3106.   template<typename _Tp>
  3107.     inline typename
  3108.     __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, void>::__type
  3109.     __fill_a(_Tp* __first, _Tp* __last, const _Tp& __c)
  3110.     {
  3111.       const _Tp __tmp = __c;
  3112.       __builtin_memset(__first, static_cast<unsigned char>(__tmp),
  3113.          __last - __first);
  3114.     }
  3115.   template<typename _ForwardIterator, typename _Tp>
  3116.     inline void
  3117.     fill(_ForwardIterator __first, _ForwardIterator __last, const _Tp& __value)
  3118.     {
  3119.      
  3120.       ;
  3121.       std::__fill_a(std::__niter_base(__first), std::__niter_base(__last),
  3122.       __value);
  3123.     }
  3124.   template<typename _OutputIterator, typename _Size, typename _Tp>
  3125.     inline typename
  3126.     __gnu_cxx::__enable_if<!__is_scalar<_Tp>::__value, _OutputIterator>::__type
  3127.     __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
  3128.     {
  3129.       for (__decltype(__n + 0) __niter = __n;
  3130.     __niter > 0; --__niter, ++__first)
  3131.  *__first = __value;
  3132.       return __first;
  3133.     }
  3134.   template<typename _OutputIterator, typename _Size, typename _Tp>
  3135.     inline typename
  3136.     __gnu_cxx::__enable_if<__is_scalar<_Tp>::__value, _OutputIterator>::__type
  3137.     __fill_n_a(_OutputIterator __first, _Size __n, const _Tp& __value)
  3138.     {
  3139.       const _Tp __tmp = __value;
  3140.       for (__decltype(__n + 0) __niter = __n;
  3141.     __niter > 0; --__niter, ++__first)
  3142.  *__first = __tmp;
  3143.       return __first;
  3144.     }
  3145.   template<typename _Size, typename _Tp>
  3146.     inline typename
  3147.     __gnu_cxx::__enable_if<__is_byte<_Tp>::__value, _Tp*>::__type
  3148.     __fill_n_a(_Tp* __first, _Size __n, const _Tp& __c)
  3149.     {
  3150.       std::__fill_a(__first, __first + __n, __c);
  3151.       return __first + __n;
  3152.     }
  3153.   template<typename _OI, typename _Size, typename _Tp>
  3154.     inline _OI
  3155.     fill_n(_OI __first, _Size __n, const _Tp& __value)
  3156.     {
  3157.      
  3158.       return _OI(std::__fill_n_a(std::__niter_base(__first), __n, __value));
  3159.     }
  3160.   template<bool _BoolType>
  3161.     struct __equal
  3162.     {
  3163.       template<typename _II1, typename _II2>
  3164.         static bool
  3165.         equal(_II1 __first1, _II1 __last1, _II2 __first2)
  3166.         {
  3167.    for (; __first1 != __last1; ++__first1, ++__first2)
  3168.      if (!(*__first1 == *__first2))
  3169.        return false;
  3170.    return true;
  3171.  }
  3172.     };
  3173.   template<>
  3174.     struct __equal<true>
  3175.     {
  3176.       template<typename _Tp>
  3177.         static bool
  3178.         equal(const _Tp* __first1, const _Tp* __last1, const _Tp* __first2)
  3179.         {
  3180.    return !__builtin_memcmp(__first1, __first2, sizeof(_Tp)
  3181.        * (__last1 - __first1));
  3182.  }
  3183.     };
  3184.   template<typename _II1, typename _II2>
  3185.     inline bool
  3186.     __equal_aux(_II1 __first1, _II1 __last1, _II2 __first2)
  3187.     {
  3188.       typedef typename iterator_traits<_II1>::value_type _ValueType1;
  3189.       typedef typename iterator_traits<_II2>::value_type _ValueType2;
  3190.       const bool __simple = ((__is_integer<_ValueType1>::__value
  3191.          || __is_pointer<_ValueType1>::__value)
  3192.                       && __is_pointer<_II1>::__value
  3193.                       && __is_pointer<_II2>::__value
  3194.         && __are_same<_ValueType1, _ValueType2>::__value);
  3195.       return std::__equal<__simple>::equal(__first1, __last1, __first2);
  3196.     }
  3197.   template<typename, typename>
  3198.     struct __lc_rai
  3199.     {
  3200.       template<typename _II1, typename _II2>
  3201.         static _II1
  3202.         __newlast1(_II1, _II1 __last1, _II2, _II2)
  3203.         { return __last1; }
  3204.       template<typename _II>
  3205.         static bool
  3206.         __cnd2(_II __first, _II __last)
  3207.         { return __first != __last; }
  3208.     };
  3209.   template<>
  3210.     struct __lc_rai<random_access_iterator_tag, random_access_iterator_tag>
  3211.     {
  3212.       template<typename _RAI1, typename _RAI2>
  3213.         static _RAI1
  3214.         __newlast1(_RAI1 __first1, _RAI1 __last1,
  3215.      _RAI2 __first2, _RAI2 __last2)
  3216.         {
  3217.    const typename iterator_traits<_RAI1>::difference_type
  3218.      __diff1 = __last1 - __first1;
  3219.    const typename iterator_traits<_RAI2>::difference_type
  3220.      __diff2 = __last2 - __first2;
  3221.    return __diff2 < __diff1 ? __first1 + __diff2 : __last1;
  3222.  }
  3223.       template<typename _RAI>
  3224.         static bool
  3225.         __cnd2(_RAI, _RAI)
  3226.         { return true; }
  3227.     };
  3228.   template<bool _BoolType>
  3229.     struct __lexicographical_compare
  3230.     {
  3231.       template<typename _II1, typename _II2>
  3232.         static bool __lc(_II1, _II1, _II2, _II2);
  3233.     };
  3234.   template<bool _BoolType>
  3235.     template<typename _II1, typename _II2>
  3236.       bool
  3237.       __lexicographical_compare<_BoolType>::
  3238.       __lc(_II1 __first1, _II1 __last1, _II2 __first2, _II2 __last2)
  3239.       {
  3240.  typedef typename iterator_traits<_II1>::iterator_category _Category1;
  3241.  typedef typename iterator_traits<_II2>::iterator_category _Category2;
  3242.  typedef std::__lc_rai<_Category1, _Category2> __rai_type;
  3243.  __last1 = __rai_type::__newlast1(__first1, __last1,
  3244.       __first2, __last2);
  3245.  for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
  3246.       ++__first1, ++__first2)
  3247.    {
  3248.      if (*__first1 < *__first2)
  3249.        return true;
  3250.      if (*__first2 < *__first1)
  3251.        return false;
  3252.    }
  3253.  return __first1 == __last1 && __first2 != __last2;
  3254.       }
  3255.   template<>
  3256.     struct __lexicographical_compare<true>
  3257.     {
  3258.       template<typename _Tp, typename _Up>
  3259.         static bool
  3260.         __lc(const _Tp* __first1, const _Tp* __last1,
  3261.       const _Up* __first2, const _Up* __last2)
  3262.  {
  3263.    const size_t __len1 = __last1 - __first1;
  3264.    const size_t __len2 = __last2 - __first2;
  3265.    const int __result = __builtin_memcmp(__first1, __first2,
  3266.       std::min(__len1, __len2));
  3267.    return __result != 0 ? __result < 0 : __len1 < __len2;
  3268.  }
  3269.     };
  3270.   template<typename _II1, typename _II2>
  3271.     inline bool
  3272.     __lexicographical_compare_aux(_II1 __first1, _II1 __last1,
  3273.       _II2 __first2, _II2 __last2)
  3274.     {
  3275.       typedef typename iterator_traits<_II1>::value_type _ValueType1;
  3276.       typedef typename iterator_traits<_II2>::value_type _ValueType2;
  3277.       const bool __simple =
  3278.  (__is_byte<_ValueType1>::__value && __is_byte<_ValueType2>::__value
  3279.   && !__gnu_cxx::__numeric_traits<_ValueType1>::__is_signed
  3280.   && !__gnu_cxx::__numeric_traits<_ValueType2>::__is_signed
  3281.   && __is_pointer<_II1>::__value
  3282.   && __is_pointer<_II2>::__value);
  3283.       return std::__lexicographical_compare<__simple>::__lc(__first1, __last1,
  3284.            __first2, __last2);
  3285.     }
  3286.   template<typename _ForwardIterator, typename _Tp>
  3287.     _ForwardIterator
  3288.     lower_bound(_ForwardIterator __first, _ForwardIterator __last,
  3289.   const _Tp& __val)
  3290.     {
  3291.       typedef typename iterator_traits<_ForwardIterator>::value_type
  3292.  _ValueType;
  3293.       typedef typename iterator_traits<_ForwardIterator>::difference_type
  3294.  _DistanceType;
  3295.      
  3296.      
  3297.       ;
  3298.       _DistanceType __len = std::distance(__first, __last);
  3299.       while (__len > 0)
  3300.  {
  3301.    _DistanceType __half = __len >> 1;
  3302.    _ForwardIterator __middle = __first;
  3303.    std::advance(__middle, __half);
  3304.    if (*__middle < __val)
  3305.      {
  3306.        __first = __middle;
  3307.        ++__first;
  3308.        __len = __len - __half - 1;
  3309.      }
  3310.    else
  3311.      __len = __half;
  3312.  }
  3313.       return __first;
  3314.     }
  3315.   template<typename _Size>
  3316.     inline _Size
  3317.     __lg(_Size __n)
  3318.     {
  3319.       _Size __k;
  3320.       for (__k = 0; __n != 0; __n >>= 1)
  3321.  ++__k;
  3322.       return __k - 1;
  3323.     }
  3324.   inline int
  3325.   __lg(int __n)
  3326.   { return sizeof(int) * 8 - 1 - __builtin_clz(__n); }
  3327.   inline unsigned
  3328.   __lg(unsigned __n)
  3329.   { return sizeof(int) * 8 - 1 - __builtin_clz(__n); }
  3330.   inline long
  3331.   __lg(long __n)
  3332.   { return sizeof(long) * 8 - 1 - __builtin_clzl(__n); }
  3333.   inline unsigned long
  3334.   __lg(unsigned long __n)
  3335.   { return sizeof(long) * 8 - 1 - __builtin_clzl(__n); }
  3336.   inline long long
  3337.   __lg(long long __n)
  3338.   { return sizeof(long long) * 8 - 1 - __builtin_clzll(__n); }
  3339.   inline unsigned long long
  3340.   __lg(unsigned long long __n)
  3341.   { return sizeof(long long) * 8 - 1 - __builtin_clzll(__n); }
  3342.  
  3343.  
  3344.   template<typename _II1, typename _II2>
  3345.     inline bool
  3346.     equal(_II1 __first1, _II1 __last1, _II2 __first2)
  3347.     {
  3348.      
  3349.      
  3350.      
  3351.       ;
  3352.       return std::__equal_aux(std::__niter_base(__first1),
  3353.          std::__niter_base(__last1),
  3354.          std::__niter_base(__first2));
  3355.     }
  3356.   template<typename _IIter1, typename _IIter2, typename _BinaryPredicate>
  3357.     inline bool
  3358.     equal(_IIter1 __first1, _IIter1 __last1,
  3359.    _IIter2 __first2, _BinaryPredicate __binary_pred)
  3360.     {
  3361.      
  3362.      
  3363.       ;
  3364.       for (; __first1 != __last1; ++__first1, ++__first2)
  3365.  if (!bool(__binary_pred(*__first1, *__first2)))
  3366.    return false;
  3367.       return true;
  3368.     }
  3369.   template<typename _II1, typename _II2>
  3370.     inline bool
  3371.     lexicographical_compare(_II1 __first1, _II1 __last1,
  3372.        _II2 __first2, _II2 __last2)
  3373.     {
  3374.       typedef typename iterator_traits<_II1>::value_type _ValueType1;
  3375.       typedef typename iterator_traits<_II2>::value_type _ValueType2;
  3376.      
  3377.      
  3378.      
  3379.      
  3380.       ;
  3381.       ;
  3382.       return std::__lexicographical_compare_aux(std::__niter_base(__first1),
  3383.       std::__niter_base(__last1),
  3384.       std::__niter_base(__first2),
  3385.       std::__niter_base(__last2));
  3386.     }
  3387.   template<typename _II1, typename _II2, typename _Compare>
  3388.     bool
  3389.     lexicographical_compare(_II1 __first1, _II1 __last1,
  3390.        _II2 __first2, _II2 __last2, _Compare __comp)
  3391.     {
  3392.       typedef typename iterator_traits<_II1>::iterator_category _Category1;
  3393.       typedef typename iterator_traits<_II2>::iterator_category _Category2;
  3394.       typedef std::__lc_rai<_Category1, _Category2> __rai_type;
  3395.      
  3396.      
  3397.       ;
  3398.       ;
  3399.       __last1 = __rai_type::__newlast1(__first1, __last1, __first2, __last2);
  3400.       for (; __first1 != __last1 && __rai_type::__cnd2(__first2, __last2);
  3401.     ++__first1, ++__first2)
  3402.  {
  3403.    if (__comp(*__first1, *__first2))
  3404.      return true;
  3405.    if (__comp(*__first2, *__first1))
  3406.      return false;
  3407.  }
  3408.       return __first1 == __last1 && __first2 != __last2;
  3409.     }
  3410.   template<typename _InputIterator1, typename _InputIterator2>
  3411.     pair<_InputIterator1, _InputIterator2>
  3412.     mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
  3413.       _InputIterator2 __first2)
  3414.     {
  3415.      
  3416.      
  3417.      
  3418.       ;
  3419.       while (__first1 != __last1 && *__first1 == *__first2)
  3420.         {
  3421.    ++__first1;
  3422.    ++__first2;
  3423.         }
  3424.       return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
  3425.     }
  3426.   template<typename _InputIterator1, typename _InputIterator2,
  3427.     typename _BinaryPredicate>
  3428.     pair<_InputIterator1, _InputIterator2>
  3429.     mismatch(_InputIterator1 __first1, _InputIterator1 __last1,
  3430.       _InputIterator2 __first2, _BinaryPredicate __binary_pred)
  3431.     {
  3432.      
  3433.      
  3434.       ;
  3435.       while (__first1 != __last1 && bool(__binary_pred(*__first1, *__first2)))
  3436.         {
  3437.    ++__first1;
  3438.    ++__first2;
  3439.         }
  3440.       return pair<_InputIterator1, _InputIterator2>(__first1, __first2);
  3441.     }
  3442.  
  3443. }
  3444.        
  3445.        
  3446. #pragma GCC visibility push(default)
  3447.        
  3448. extern "C++" {
  3449. namespace std
  3450. {
  3451.   class exception
  3452.   {
  3453.   public:
  3454.     exception() noexcept { }
  3455.     virtual ~exception() noexcept;
  3456.     virtual const char* what() const noexcept;
  3457.   };
  3458.   class bad_exception : public exception
  3459.   {
  3460.   public:
  3461.     bad_exception() noexcept { }
  3462.     virtual ~bad_exception() noexcept;
  3463.     virtual const char* what() const noexcept;
  3464.   };
  3465.   typedef void (*terminate_handler) ();
  3466.   typedef void (*unexpected_handler) ();
  3467.   terminate_handler set_terminate(terminate_handler) noexcept;
  3468.   void terminate() noexcept __attribute__ ((__noreturn__));
  3469.   unexpected_handler set_unexpected(unexpected_handler) noexcept;
  3470.   void unexpected() __attribute__ ((__noreturn__));
  3471.   bool uncaught_exception() noexcept __attribute__ ((__pure__));
  3472. }
  3473. namespace __gnu_cxx
  3474. {
  3475.  
  3476.   void __verbose_terminate_handler();
  3477.  
  3478. }
  3479. }
  3480. #pragma GCC visibility pop
  3481. #pragma GCC visibility push(default)
  3482. extern "C++" {
  3483. namespace std
  3484. {
  3485.   namespace __exception_ptr
  3486.   {
  3487.     class exception_ptr;
  3488.   }
  3489.   using __exception_ptr::exception_ptr;
  3490.   exception_ptr current_exception() noexcept;
  3491.   void rethrow_exception(exception_ptr) __attribute__ ((__noreturn__));
  3492.   namespace __exception_ptr
  3493.   {
  3494.     class exception_ptr
  3495.     {
  3496.       void* _M_exception_object;
  3497.       explicit exception_ptr(void* __e) noexcept;
  3498.       void _M_addref() noexcept;
  3499.       void _M_release() noexcept;
  3500.       void *_M_get() const noexcept __attribute__ ((__pure__));
  3501.       friend exception_ptr std::current_exception() noexcept;
  3502.       friend void std::rethrow_exception(exception_ptr);
  3503.     public:
  3504.       exception_ptr() noexcept;
  3505.       exception_ptr(const exception_ptr&) noexcept;
  3506.       exception_ptr(nullptr_t) noexcept
  3507.       : _M_exception_object(0)
  3508.       { }
  3509.       exception_ptr(exception_ptr&& __o) noexcept
  3510.       : _M_exception_object(__o._M_exception_object)
  3511.       { __o._M_exception_object = 0; }
  3512.       exception_ptr&
  3513.       operator=(const exception_ptr&) noexcept;
  3514.       exception_ptr&
  3515.       operator=(exception_ptr&& __o) noexcept
  3516.       {
  3517.         exception_ptr(static_cast<exception_ptr&&>(__o)).swap(*this);
  3518.         return *this;
  3519.       }
  3520.       ~exception_ptr() noexcept;
  3521.       void
  3522.       swap(exception_ptr&) noexcept;
  3523.       explicit operator bool() const
  3524.       { return _M_exception_object; }
  3525.       friend bool
  3526.       operator==(const exception_ptr&, const exception_ptr&)
  3527.  noexcept __attribute__ ((__pure__));
  3528.       const class type_info*
  3529.       __cxa_exception_type() const noexcept
  3530.  __attribute__ ((__pure__));
  3531.     };
  3532.     bool
  3533.     operator==(const exception_ptr&, const exception_ptr&)
  3534.       noexcept __attribute__ ((__pure__));
  3535.     bool
  3536.     operator!=(const exception_ptr&, const exception_ptr&)
  3537.       noexcept __attribute__ ((__pure__));
  3538.     inline void
  3539.     swap(exception_ptr& __lhs, exception_ptr& __rhs)
  3540.     { __lhs.swap(__rhs); }
  3541.   }
  3542.   template<typename _Ex>
  3543.     exception_ptr
  3544.     copy_exception(_Ex __ex) noexcept
  3545.     {
  3546.       try
  3547.  {
  3548.    throw __ex;
  3549.  }
  3550.       catch(...)
  3551.  {
  3552.    return current_exception();
  3553.  }
  3554.     }
  3555.   template<typename _Ex>
  3556.     exception_ptr
  3557.     make_exception_ptr(_Ex __ex) noexcept
  3558.     { return std::copy_exception<_Ex>(__ex); }
  3559. }
  3560. }
  3561. #pragma GCC visibility pop
  3562. #pragma GCC visibility push(default)
  3563. extern "C++" {
  3564. namespace std
  3565. {
  3566.   class nested_exception
  3567.   {
  3568.     exception_ptr _M_ptr;
  3569.   public:
  3570.     nested_exception() noexcept : _M_ptr(current_exception()) { }
  3571.     nested_exception(const nested_exception&) = default;
  3572.     nested_exception& operator=(const nested_exception&) = default;
  3573.     virtual ~nested_exception() noexcept;
  3574.     void
  3575.     rethrow_nested() const __attribute__ ((__noreturn__))
  3576.     { rethrow_exception(_M_ptr); }
  3577.     exception_ptr
  3578.     nested_ptr() const
  3579.     { return _M_ptr; }
  3580.   };
  3581.   template<typename _Except>
  3582.     struct _Nested_exception : public _Except, public nested_exception
  3583.     {
  3584.       explicit _Nested_exception(_Except&& __ex)
  3585.       : _Except(static_cast<_Except&&>(__ex))
  3586.       { }
  3587.     };
  3588.   template<typename _Ex>
  3589.     struct __get_nested_helper
  3590.     {
  3591.       static const nested_exception*
  3592.       _S_get(const _Ex& __ex)
  3593.       { return dynamic_cast<const nested_exception*>(&__ex); }
  3594.     };
  3595.   template<typename _Ex>
  3596.     struct __get_nested_helper<_Ex*>
  3597.     {
  3598.       static const nested_exception*
  3599.       _S_get(const _Ex* __ex)
  3600.       { return dynamic_cast<const nested_exception*>(__ex); }
  3601.     };
  3602.   template<typename _Ex>
  3603.     inline const nested_exception*
  3604.     __get_nested_exception(const _Ex& __ex)
  3605.     { return __get_nested_helper<_Ex>::_S_get(__ex); }
  3606.   template<typename _Ex>
  3607.     void
  3608.     __throw_with_nested(_Ex&&, const nested_exception* = 0)
  3609.     __attribute__ ((__noreturn__));
  3610.   template<typename _Ex>
  3611.     void
  3612.     __throw_with_nested(_Ex&&, ...) __attribute__ ((__noreturn__));
  3613.   template<typename _Ex>
  3614.     inline void
  3615.     __throw_with_nested(_Ex&& __ex, const nested_exception*)
  3616.     { throw __ex; }
  3617.   template<typename _Ex>
  3618.     inline void
  3619.     __throw_with_nested(_Ex&& __ex, ...)
  3620.     { throw _Nested_exception<_Ex>(static_cast<_Ex&&>(__ex)); }
  3621.   template<typename _Ex>
  3622.     void
  3623.     throw_with_nested(_Ex __ex) __attribute__ ((__noreturn__));
  3624.   template<typename _Ex>
  3625.     inline void
  3626.     throw_with_nested(_Ex __ex)
  3627.     {
  3628.       if (__get_nested_exception(__ex))
  3629.         throw __ex;
  3630.       __throw_with_nested(static_cast<_Ex&&>(__ex), &__ex);
  3631.     }
  3632.   template<typename _Ex>
  3633.     inline void
  3634.     rethrow_if_nested(const _Ex& __ex)
  3635.     {
  3636.       if (const nested_exception* __nested = __get_nested_exception(__ex))
  3637.         __nested->rethrow_nested();
  3638.     }
  3639.   inline void
  3640.   rethrow_if_nested(const nested_exception& __ex)
  3641.   { __ex.rethrow_nested(); }
  3642. }
  3643. }
  3644. #pragma GCC visibility pop
  3645. #pragma GCC visibility push(default)
  3646. extern "C++" {
  3647. namespace std
  3648. {
  3649.   class bad_alloc : public exception
  3650.   {
  3651.   public:
  3652.     bad_alloc() throw() { }
  3653.     virtual ~bad_alloc() throw();
  3654.     virtual const char* what() const throw();
  3655.   };
  3656.   struct nothrow_t { };
  3657.   extern const nothrow_t nothrow;
  3658.   typedef void (*new_handler)();
  3659.   new_handler set_new_handler(new_handler) throw();
  3660. }
  3661. void* operator new(std::size_t)
  3662.   __attribute__((__externally_visible__));
  3663. void* operator new[](std::size_t)
  3664.   __attribute__((__externally_visible__));
  3665. void operator delete(void*) noexcept
  3666.   __attribute__((__externally_visible__));
  3667. void operator delete[](void*) noexcept
  3668.   __attribute__((__externally_visible__));
  3669. void* operator new(std::size_t, const std::nothrow_t&) noexcept
  3670.   __attribute__((__externally_visible__));
  3671. void* operator new[](std::size_t, const std::nothrow_t&) noexcept
  3672.   __attribute__((__externally_visible__));
  3673. void operator delete(void*, const std::nothrow_t&) noexcept
  3674.   __attribute__((__externally_visible__));
  3675. void operator delete[](void*, const std::nothrow_t&) noexcept
  3676.   __attribute__((__externally_visible__));
  3677. inline void* operator new(std::size_t, void* __p) noexcept
  3678. { return __p; }
  3679. inline void* operator new[](std::size_t, void* __p) noexcept
  3680. { return __p; }
  3681. inline void operator delete (void*, void*) noexcept { }
  3682. inline void operator delete[](void*, void*) noexcept { }
  3683. }
  3684. #pragma GCC visibility pop
  3685. namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
  3686. {
  3687.  
  3688.   using std::size_t;
  3689.   using std::ptrdiff_t;
  3690.   template<typename _Tp>
  3691.     class new_allocator
  3692.     {
  3693.     public:
  3694.       typedef size_t size_type;
  3695.       typedef ptrdiff_t difference_type;
  3696.       typedef _Tp* pointer;
  3697.       typedef const _Tp* const_pointer;
  3698.       typedef _Tp& reference;
  3699.       typedef const _Tp& const_reference;
  3700.       typedef _Tp value_type;
  3701.       template<typename _Tp1>
  3702.         struct rebind
  3703.         { typedef new_allocator<_Tp1> other; };
  3704.       new_allocator() noexcept { }
  3705.       new_allocator(const new_allocator&) noexcept { }
  3706.       template<typename _Tp1>
  3707.         new_allocator(const new_allocator<_Tp1>&) noexcept { }
  3708.       ~new_allocator() noexcept { }
  3709.       pointer
  3710.       address(reference __x) const noexcept
  3711.       { return std::__addressof(__x); }
  3712.       const_pointer
  3713.       address(const_reference __x) const noexcept
  3714.       { return std::__addressof(__x); }
  3715.       pointer
  3716.       allocate(size_type __n, const void* = 0)
  3717.       {
  3718.  if (__n > this->max_size())
  3719.    std::__throw_bad_alloc();
  3720.  return static_cast<_Tp*>(::operator new(__n * sizeof(_Tp)));
  3721.       }
  3722.       void
  3723.       deallocate(pointer __p, size_type)
  3724.       { ::operator delete(__p); }
  3725.       size_type
  3726.       max_size() const noexcept
  3727.       { return size_t(-1) / sizeof(_Tp); }
  3728.       template<typename _Up, typename... _Args>
  3729.         void
  3730.         construct(_Up* __p, _Args&&... __args)
  3731.  { ::new((void *)__p) _Up(std::forward<_Args>(__args)...); }
  3732.       template<typename _Up>
  3733.         void
  3734.         destroy(_Up* __p) { __p->~_Up(); }
  3735.     };
  3736.   template<typename _Tp>
  3737.     inline bool
  3738.     operator==(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
  3739.     { return true; }
  3740.   template<typename _Tp>
  3741.     inline bool
  3742.     operator!=(const new_allocator<_Tp>&, const new_allocator<_Tp>&)
  3743.     { return false; }
  3744.  
  3745. }
  3746. namespace std __attribute__ ((__visibility__ ("default")))
  3747. {
  3748.  
  3749.   template<typename _Tp>
  3750.     class allocator;
  3751.   template<>
  3752.     class allocator<void>
  3753.     {
  3754.     public:
  3755.       typedef size_t size_type;
  3756.       typedef ptrdiff_t difference_type;
  3757.       typedef void* pointer;
  3758.       typedef const void* const_pointer;
  3759.       typedef void value_type;
  3760.       template<typename _Tp1>
  3761.         struct rebind
  3762.         { typedef allocator<_Tp1> other; };
  3763.     };
  3764.   template<typename _Tp>
  3765.     class allocator: public __gnu_cxx::new_allocator<_Tp>
  3766.     {
  3767.    public:
  3768.       typedef size_t size_type;
  3769.       typedef ptrdiff_t difference_type;
  3770.       typedef _Tp* pointer;
  3771.       typedef const _Tp* const_pointer;
  3772.       typedef _Tp& reference;
  3773.       typedef const _Tp& const_reference;
  3774.       typedef _Tp value_type;
  3775.       template<typename _Tp1>
  3776.         struct rebind
  3777.         { typedef allocator<_Tp1> other; };
  3778.       allocator() throw() { }
  3779.       allocator(const allocator& __a) throw()
  3780.       : __gnu_cxx::new_allocator<_Tp>(__a) { }
  3781.       template<typename _Tp1>
  3782.         allocator(const allocator<_Tp1>&) throw() { }
  3783.       ~allocator() throw() { }
  3784.     };
  3785.   template<typename _T1, typename _T2>
  3786.     inline bool
  3787.     operator==(const allocator<_T1>&, const allocator<_T2>&)
  3788.     { return true; }
  3789.   template<typename _Tp>
  3790.     inline bool
  3791.     operator==(const allocator<_Tp>&, const allocator<_Tp>&)
  3792.     { return true; }
  3793.   template<typename _T1, typename _T2>
  3794.     inline bool
  3795.     operator!=(const allocator<_T1>&, const allocator<_T2>&)
  3796.     { return false; }
  3797.   template<typename _Tp>
  3798.     inline bool
  3799.     operator!=(const allocator<_Tp>&, const allocator<_Tp>&)
  3800.     { return false; }
  3801.   extern template class allocator<char>;
  3802.   extern template class allocator<wchar_t>;
  3803.   template<typename _Alloc, bool = __is_empty(_Alloc)>
  3804.     struct __alloc_swap
  3805.     { static void _S_do_it(_Alloc&, _Alloc&) { } };
  3806.   template<typename _Alloc>
  3807.     struct __alloc_swap<_Alloc, false>
  3808.     {
  3809.       static void
  3810.       _S_do_it(_Alloc& __one, _Alloc& __two)
  3811.       {
  3812.  if (__one != __two)
  3813.    swap(__one, __two);
  3814.       }
  3815.     };
  3816.   template<typename _Alloc, bool = __is_empty(_Alloc)>
  3817.     struct __alloc_neq
  3818.     {
  3819.       static bool
  3820.       _S_do_it(const _Alloc&, const _Alloc&)
  3821.       { return false; }
  3822.     };
  3823.   template<typename _Alloc>
  3824.     struct __alloc_neq<_Alloc, false>
  3825.     {
  3826.       static bool
  3827.       _S_do_it(const _Alloc& __one, const _Alloc& __two)
  3828.       { return __one != __two; }
  3829.     };
  3830.   template<typename _Tp, bool
  3831.     = __or_<is_copy_constructible<typename _Tp::value_type>,
  3832.             is_nothrow_move_constructible<typename _Tp::value_type>>::value>
  3833.     struct __shrink_to_fit_aux
  3834.     { static bool _S_do_it(_Tp&) { return false; } };
  3835.   template<typename _Tp>
  3836.     struct __shrink_to_fit_aux<_Tp, true>
  3837.     {
  3838.       static bool
  3839.       _S_do_it(_Tp& __c)
  3840.       {
  3841.  try
  3842.    {
  3843.      _Tp(__make_move_if_noexcept_iterator(__c.begin()),
  3844.   __make_move_if_noexcept_iterator(__c.end()),
  3845.   __c.get_allocator()).swap(__c);
  3846.      return true;
  3847.    }
  3848.  catch(...)
  3849.    { return false; }
  3850.       }
  3851.     };
  3852.   template<typename, typename>
  3853.     struct uses_allocator;
  3854.  
  3855. }
  3856.        
  3857. namespace std __attribute__ ((__visibility__ ("default")))
  3858. {
  3859.  
  3860. template<typename _Tp> class __has_element_type_helper : __sfinae_types { template<typename _Up> struct _Wrap_type { }; template<typename _Up> static __one __test(_Wrap_type<typename _Up::element_type>*); template<typename _Up> static __two __test(...); public: static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; }; template<typename _Tp> struct __has_element_type : integral_constant<bool, __has_element_type_helper <typename remove_cv<_Tp>::type>::value> { };
  3861. template<typename _Tp> class __has_difference_type_helper : __sfinae_types { template<typename _Up> struct _Wrap_type { }; template<typename _Up> static __one __test(_Wrap_type<typename _Up::difference_type>*); template<typename _Up> static __two __test(...); public: static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; }; template<typename _Tp> struct __has_difference_type : integral_constant<bool, __has_difference_type_helper <typename remove_cv<_Tp>::type>::value> { };
  3862.   template<typename _Tp, bool = __has_element_type<_Tp>::value>
  3863.     struct __ptrtr_elt_type;
  3864.   template<typename _Tp>
  3865.     struct __ptrtr_elt_type<_Tp, true>
  3866.     {
  3867.       typedef typename _Tp::element_type __type;
  3868.     };
  3869.   template<template<typename, typename...> class _SomePtr, typename _Tp,
  3870.             typename... _Args>
  3871.     struct __ptrtr_elt_type<_SomePtr<_Tp, _Args...>, false>
  3872.     {
  3873.       typedef _Tp __type;
  3874.     };
  3875.   template<typename _Tp, bool = __has_difference_type<_Tp>::value>
  3876.     struct __ptrtr_diff_type
  3877.     {
  3878.       typedef typename _Tp::difference_type __type;
  3879.     };
  3880.   template<typename _Tp>
  3881.     struct __ptrtr_diff_type<_Tp, false>
  3882.     {
  3883.       typedef ptrdiff_t __type;
  3884.     };
  3885.   template<typename _Ptr, typename _Up>
  3886.     class __ptrtr_rebind_helper
  3887.     {
  3888.       template<typename _Ptr2, typename _Up2>
  3889.  static constexpr bool
  3890.         _S_chk(typename _Ptr2::template rebind<_Up2>*)
  3891.         { return true; }
  3892.       template<typename, typename>
  3893.         static constexpr bool
  3894.         _S_chk(...)
  3895.         { return false; }
  3896.     public:
  3897.       static const bool __value = _S_chk<_Ptr, _Up>(nullptr);
  3898.     };
  3899.   template<typename _Ptr, typename _Up>
  3900.     const bool __ptrtr_rebind_helper<_Ptr, _Up>::__value;
  3901.   template<typename _Tp, typename _Up,
  3902.            bool = __ptrtr_rebind_helper<_Tp, _Up>::__value>
  3903.     struct __ptrtr_rebind;
  3904.   template<typename _Tp, typename _Up>
  3905.     struct __ptrtr_rebind<_Tp, _Up, true>
  3906.     {
  3907.       typedef typename _Tp::template rebind<_Up> __type;
  3908.     };
  3909.   template<template<typename, typename...> class _SomePtr, typename _Up,
  3910.             typename _Tp, typename... _Args>
  3911.     struct __ptrtr_rebind<_SomePtr<_Tp, _Args...>, _Up, false>
  3912.     {
  3913.       typedef _SomePtr<_Up, _Args...> __type;
  3914.     };
  3915.   template<typename _Tp, typename = typename remove_cv<_Tp>::type>
  3916.     struct __ptrtr_not_void
  3917.     {
  3918.       typedef _Tp __type;
  3919.     };
  3920.   template<typename _Tp>
  3921.     struct __ptrtr_not_void<_Tp, void>
  3922.     {
  3923.       struct __type { };
  3924.     };
  3925.   template<typename _Ptr>
  3926.     class __ptrtr_pointer_to
  3927.     {
  3928.       typedef typename __ptrtr_elt_type<_Ptr>::__type __orig_type;
  3929.       typedef typename __ptrtr_not_void<__orig_type>::__type __element_type;
  3930.     public:
  3931.       static _Ptr pointer_to(__element_type& __e)
  3932.       { return _Ptr::pointer_to(__e); }
  3933.     };
  3934.   template<typename _Ptr>
  3935.     struct pointer_traits : __ptrtr_pointer_to<_Ptr>
  3936.     {
  3937.       typedef _Ptr pointer;
  3938.       typedef typename __ptrtr_elt_type<_Ptr>::__type element_type;
  3939.       typedef typename __ptrtr_diff_type<_Ptr>::__type difference_type;
  3940.       template<typename _Up>
  3941.         using rebind = typename __ptrtr_rebind<_Ptr, _Up>::__type;
  3942.     };
  3943.   template<typename _Tp>
  3944.     struct pointer_traits<_Tp*>
  3945.     {
  3946.       typedef _Tp* pointer;
  3947.       typedef _Tp element_type;
  3948.       typedef ptrdiff_t difference_type;
  3949.       template<typename _Up>
  3950.         using rebind = _Up*;
  3951.       static pointer
  3952.       pointer_to(typename __ptrtr_not_void<element_type>::__type& __r) noexcept
  3953.       { return std::addressof(__r); }
  3954.     };
  3955.  
  3956. }
  3957. namespace std __attribute__ ((__visibility__ ("default")))
  3958. {
  3959.  
  3960.   template<typename _Alloc, typename _Tp>
  3961.     class __alloctr_rebind_helper
  3962.     {
  3963.       template<typename _Alloc2, typename _Tp2>
  3964.  static constexpr bool
  3965.         _S_chk(typename _Alloc2::template rebind<_Tp2>::other*)
  3966.  { return true; }
  3967.       template<typename, typename>
  3968.         static constexpr bool
  3969.         _S_chk(...)
  3970.         { return false; }
  3971.     public:
  3972.       static const bool __value = _S_chk<_Alloc, _Tp>(nullptr);
  3973.     };
  3974.   template<typename _Alloc, typename _Tp>
  3975.     const bool __alloctr_rebind_helper<_Alloc, _Tp>::__value;
  3976.   template<typename _Alloc, typename _Tp,
  3977.            bool = __alloctr_rebind_helper<_Alloc, _Tp>::__value>
  3978.     struct __alloctr_rebind;
  3979.   template<typename _Alloc, typename _Tp>
  3980.     struct __alloctr_rebind<_Alloc, _Tp, true>
  3981.     {
  3982.       typedef typename _Alloc::template rebind<_Tp>::other __type;
  3983.     };
  3984.   template<template<typename, typename...> class _Alloc, typename _Tp,
  3985.             typename _Up, typename... _Args>
  3986.     struct __alloctr_rebind<_Alloc<_Up, _Args...>, _Tp, false>
  3987.     {
  3988.       typedef _Alloc<_Tp, _Args...> __type;
  3989.     };
  3990.   template<typename _Alloc>
  3991.     struct allocator_traits
  3992.     {
  3993.       typedef _Alloc allocator_type;
  3994.       typedef typename _Alloc::value_type value_type;
  3995. private: template<typename _Tp> static typename _Tp::pointer _S_pointer_helper(_Tp*); static value_type* _S_pointer_helper(...); typedef decltype(_S_pointer_helper((_Alloc*)0)) __pointer; public:
  3996.       typedef __pointer pointer;
  3997. private: template<typename _Tp> static typename _Tp::const_pointer _S_const_pointer_helper(_Tp*); static typename pointer_traits<pointer>::template rebind<const value_type> _S_const_pointer_helper(...); typedef decltype(_S_const_pointer_helper((_Alloc*)0)) __const_pointer; public:
  3998.       typedef __const_pointer const_pointer;
  3999. private: template<typename _Tp> static typename _Tp::void_pointer _S_void_pointer_helper(_Tp*); static typename pointer_traits<pointer>::template rebind<void> _S_void_pointer_helper(...); typedef decltype(_S_void_pointer_helper((_Alloc*)0)) __void_pointer; public:
  4000.       typedef __void_pointer void_pointer;
  4001. private: template<typename _Tp> static typename _Tp::const_void_pointer _S_const_void_pointer_helper(_Tp*); static typename pointer_traits<pointer>::template rebind<const void> _S_const_void_pointer_helper(...); typedef decltype(_S_const_void_pointer_helper((_Alloc*)0)) __const_void_pointer; public:
  4002.       typedef __const_void_pointer const_void_pointer;
  4003. private: template<typename _Tp> static typename _Tp::difference_type _S_difference_type_helper(_Tp*); static typename pointer_traits<pointer>::difference_type _S_difference_type_helper(...); typedef decltype(_S_difference_type_helper((_Alloc*)0)) __difference_type; public:
  4004.       typedef __difference_type difference_type;
  4005. private: template<typename _Tp> static typename _Tp::size_type _S_size_type_helper(_Tp*); static typename make_unsigned<difference_type>::type _S_size_type_helper(...); typedef decltype(_S_size_type_helper((_Alloc*)0)) __size_type; public:
  4006.       typedef __size_type size_type;
  4007. private: template<typename _Tp> static typename _Tp::propagate_on_container_copy_assignment _S_propagate_on_container_copy_assignment_helper(_Tp*); static false_type _S_propagate_on_container_copy_assignment_helper(...); typedef decltype(_S_propagate_on_container_copy_assignment_helper((_Alloc*)0)) __propagate_on_container_copy_assignment; public:
  4008.       typedef __propagate_on_container_copy_assignment
  4009.         propagate_on_container_copy_assignment;
  4010. private: template<typename _Tp> static typename _Tp::propagate_on_container_move_assignment _S_propagate_on_container_move_assignment_helper(_Tp*); static false_type _S_propagate_on_container_move_assignment_helper(...); typedef decltype(_S_propagate_on_container_move_assignment_helper((_Alloc*)0)) __propagate_on_container_move_assignment; public:
  4011.       typedef __propagate_on_container_move_assignment
  4012.         propagate_on_container_move_assignment;
  4013. private: template<typename _Tp> static typename _Tp::propagate_on_container_swap _S_propagate_on_container_swap_helper(_Tp*); static false_type _S_propagate_on_container_swap_helper(...); typedef decltype(_S_propagate_on_container_swap_helper((_Alloc*)0)) __propagate_on_container_swap; public:
  4014.       typedef __propagate_on_container_swap propagate_on_container_swap;
  4015.       template<typename _Tp>
  4016.         using rebind_alloc = typename __alloctr_rebind<_Alloc, _Tp>::__type;
  4017.       template<typename _Tp>
  4018.         using rebind_traits = allocator_traits<rebind_alloc<_Tp>>;
  4019.     private:
  4020.       template<typename _Alloc2>
  4021.  struct __allocate_helper
  4022.  {
  4023.    template<typename _Alloc3,
  4024.      typename = decltype(std::declval<_Alloc3*>()->allocate(
  4025.     std::declval<size_type>(),
  4026.     std::declval<const_void_pointer>()))>
  4027.      static true_type __test(int);
  4028.    template<typename>
  4029.      static false_type __test(...);
  4030.    typedef decltype(__test<_Alloc>(0)) type;
  4031.    static const bool value = type::value;
  4032.  };
  4033.       template<typename _Alloc2>
  4034.  static typename
  4035.         enable_if<__allocate_helper<_Alloc2>::value, pointer>::type
  4036.         _S_allocate(_Alloc2& __a, size_type __n, const_void_pointer __hint)
  4037.  { return __a.allocate(__n, __hint); }
  4038.       template<typename _Alloc2>
  4039.  static typename
  4040.         enable_if<!__allocate_helper<_Alloc2>::value, pointer>::type
  4041.         _S_allocate(_Alloc2& __a, size_type __n, ...)
  4042.  { return __a.allocate(__n); }
  4043.       template<typename _Tp, typename... _Args>
  4044.  struct __construct_helper
  4045.  {
  4046.    template<typename _Alloc2,
  4047.      typename = decltype(std::declval<_Alloc2*>()->construct(
  4048.     std::declval<_Tp*>(), std::declval<_Args>()...))>
  4049.      static true_type __test(int);
  4050.    template<typename>
  4051.      static false_type __test(...);
  4052.    typedef decltype(__test<_Alloc>(0)) type;
  4053.    static const bool value = type::value;
  4054.  };
  4055.       template<typename _Tp, typename... _Args>
  4056.  static typename
  4057.         enable_if<__construct_helper<_Tp, _Args...>::value, void>::type
  4058.         _S_construct(_Alloc& __a, _Tp* __p, _Args&&... __args)
  4059.  { __a.construct(__p, std::forward<_Args>(__args)...); }
  4060.       template<typename _Tp, typename... _Args>
  4061.  static typename
  4062.         enable_if<!__construct_helper<_Tp, _Args...>::value, void>::type
  4063.         _S_construct(_Alloc&, _Tp* __p, _Args&&... __args)
  4064.  { ::new((void*)__p) _Tp(std::forward<_Args>(__args)...); }
  4065.       template<typename _Tp>
  4066.  struct __destroy_helper
  4067.  {
  4068.    template<typename _Alloc2,
  4069.      typename = decltype(std::declval<_Alloc2*>()->destroy(
  4070.     std::declval<_Tp*>()))>
  4071.      static true_type __test(int);
  4072.    template<typename>
  4073.      static false_type __test(...);
  4074.    typedef decltype(__test<_Alloc>(0)) type;
  4075.    static const bool value = type::value;
  4076.  };
  4077.       template<typename _Tp>
  4078.  static typename enable_if<__destroy_helper<_Tp>::value, void>::type
  4079.         _S_destroy(_Alloc& __a, _Tp* __p)
  4080.  { __a.destroy(__p); }
  4081.       template<typename _Tp>
  4082.  static typename enable_if<!__destroy_helper<_Tp>::value, void>::type
  4083.         _S_destroy(_Alloc&, _Tp* __p)
  4084.  { __p->~_Tp(); }
  4085.       template<typename _Alloc2>
  4086.  struct __maxsize_helper
  4087.  {
  4088.    template<typename _Alloc3,
  4089.      typename = decltype(std::declval<_Alloc3*>()->max_size())>
  4090.      static true_type __test(int);
  4091.    template<typename>
  4092.      static false_type __test(...);
  4093.    typedef decltype(__test<_Alloc2>(0)) type;
  4094.    static const bool value = type::value;
  4095.  };
  4096.       template<typename _Alloc2>
  4097.  static typename
  4098.         enable_if<__maxsize_helper<_Alloc2>::value, size_type>::type
  4099.         _S_max_size(_Alloc2& __a)
  4100.  { return __a.max_size(); }
  4101.       template<typename _Alloc2>
  4102.  static typename
  4103.         enable_if<!__maxsize_helper<_Alloc2>::value, size_type>::type
  4104.  _S_max_size(_Alloc2&)
  4105.  { return __gnu_cxx::__numeric_traits<size_type>::__max; }
  4106.       template<typename _Alloc2>
  4107.  struct __select_helper
  4108.  {
  4109.    template<typename _Alloc3, typename
  4110.      = decltype(std::declval<_Alloc3*>()
  4111.   ->select_on_container_copy_construction())>
  4112.      static true_type __test(int);
  4113.    template<typename>
  4114.      static false_type __test(...);
  4115.    typedef decltype(__test<_Alloc2>(0)) type;
  4116.    static const bool value = type::value;
  4117.  };
  4118.       template<typename _Alloc2>
  4119.  static typename
  4120.         enable_if<__select_helper<_Alloc2>::value, _Alloc2>::type
  4121.         _S_select(_Alloc2& __a)
  4122.  { return __a.select_on_container_copy_construction(); }
  4123.       template<typename _Alloc2>
  4124.  static typename
  4125.         enable_if<!__select_helper<_Alloc2>::value, _Alloc2>::type
  4126.         _S_select(_Alloc2& __a)
  4127.  { return __a; }
  4128.     public:
  4129.       static pointer
  4130.       allocate(_Alloc& __a, size_type __n)
  4131.       { return __a.allocate(__n); }
  4132.       static pointer
  4133.       allocate(_Alloc& __a, size_type __n, const_void_pointer __hint)
  4134.       { return _S_allocate(__a, __n, __hint); }
  4135.       static void deallocate(_Alloc& __a, pointer __p, size_type __n)
  4136.       { __a.deallocate(__p, __n); }
  4137.       template<typename _Tp, typename... _Args>
  4138.  static void construct(_Alloc& __a, _Tp* __p, _Args&&... __args)
  4139.  { _S_construct(__a, __p, std::forward<_Args>(__args)...); }
  4140.       template <class _Tp>
  4141.  static void destroy(_Alloc& __a, _Tp* __p)
  4142.  { _S_destroy(__a, __p); }
  4143.       static size_type max_size(const _Alloc& __a)
  4144.       { return _S_max_size(__a); }
  4145.       static _Alloc
  4146.       select_on_container_copy_construction(const _Alloc& __rhs)
  4147.       { return _S_select(__rhs); }
  4148.     };
  4149.   template<typename _Alloc>
  4150.   template<typename _Alloc2>
  4151.     const bool allocator_traits<_Alloc>::__allocate_helper<_Alloc2>::value;
  4152.   template<typename _Alloc>
  4153.   template<typename _Tp, typename... _Args>
  4154.     const bool
  4155.     allocator_traits<_Alloc>::__construct_helper<_Tp, _Args...>::value;
  4156.   template<typename _Alloc>
  4157.   template<typename _Tp>
  4158.     const bool allocator_traits<_Alloc>::__destroy_helper<_Tp>::value;
  4159.   template<typename _Alloc>
  4160.   template<typename _Alloc2>
  4161.     const bool allocator_traits<_Alloc>::__maxsize_helper<_Alloc2>::value;
  4162.   template<typename _Alloc>
  4163.   template<typename _Alloc2>
  4164.     const bool allocator_traits<_Alloc>::__select_helper<_Alloc2>::value;
  4165.   template<typename _Alloc>
  4166.     inline void
  4167.     __do_alloc_on_copy(_Alloc& __one, const _Alloc& __two, true_type)
  4168.     { __one = __two; }
  4169.   template<typename _Alloc>
  4170.     inline void
  4171.     __do_alloc_on_copy(_Alloc&, const _Alloc&, false_type)
  4172.     { }
  4173.   template<typename _Alloc>
  4174.     inline void __alloc_on_copy(_Alloc& __one, const _Alloc& __two)
  4175.     {
  4176.       typedef allocator_traits<_Alloc> __traits;
  4177.       typedef typename __traits::propagate_on_container_copy_assignment __pocca;
  4178.       __do_alloc_on_copy(__one, __two, __pocca());
  4179.     }
  4180.   template<typename _Alloc>
  4181.     inline _Alloc __alloc_on_copy(const _Alloc& __a)
  4182.     {
  4183.       typedef allocator_traits<_Alloc> __traits;
  4184.       return __traits::select_on_container_copy_construction(__a);
  4185.     }
  4186.   template<typename _Alloc>
  4187.     inline void __do_alloc_on_move(_Alloc& __one, _Alloc& __two, true_type)
  4188.     { __one = std::move(__two); }
  4189.   template<typename _Alloc>
  4190.     inline void __do_alloc_on_move(_Alloc&, _Alloc&, false_type)
  4191.     { }
  4192.   template<typename _Alloc>
  4193.     inline void __alloc_on_move(_Alloc& __one, _Alloc& __two)
  4194.     {
  4195.       typedef allocator_traits<_Alloc> __traits;
  4196.       typedef typename __traits::propagate_on_container_move_assignment __pocma;
  4197.       __do_alloc_on_move(__one, __two, __pocma());
  4198.     }
  4199.   template<typename _Alloc>
  4200.     inline void __do_alloc_on_swap(_Alloc& __one, _Alloc& __two, true_type)
  4201.     {
  4202.       using std::swap;
  4203.       swap(__one, __two);
  4204.     }
  4205.   template<typename _Alloc>
  4206.     inline void __do_alloc_on_swap(_Alloc&, _Alloc&, false_type)
  4207.     { }
  4208.   template<typename _Alloc>
  4209.     inline void __alloc_on_swap(_Alloc& __one, _Alloc& __two)
  4210.     {
  4211.       typedef allocator_traits<_Alloc> __traits;
  4212.       typedef typename __traits::propagate_on_container_swap __pocs;
  4213.       __do_alloc_on_swap(__one, __two, __pocs());
  4214.     }
  4215.  
  4216. }
  4217. namespace std __attribute__ ((__visibility__ ("default")))
  4218. {
  4219.  
  4220.   template<typename> struct allocator;
  4221.  
  4222. }
  4223. namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
  4224. {
  4225.  
  4226.   template<typename _Alloc>
  4227.     struct __allocator_always_compares_equal
  4228.     { static const bool value = false; };
  4229.   template<typename _Alloc>
  4230.     const bool __allocator_always_compares_equal<_Alloc>::value;
  4231.   template<typename _Tp>
  4232.     struct __allocator_always_compares_equal<std::allocator<_Tp>>
  4233.     { static const bool value = true; };
  4234.   template<typename _Tp>
  4235.     const bool __allocator_always_compares_equal<std::allocator<_Tp>>::value;
  4236.   template<typename, typename> struct array_allocator;
  4237.   template<typename _Tp, typename _Array>
  4238.     struct __allocator_always_compares_equal<array_allocator<_Tp, _Array>>
  4239.     { static const bool value = true; };
  4240.   template<typename _Tp, typename _Array>
  4241.     const bool
  4242.     __allocator_always_compares_equal<array_allocator<_Tp, _Array>>::value;
  4243.   template<typename> struct mt_allocator;
  4244.   template<typename _Tp>
  4245.     struct __allocator_always_compares_equal<mt_allocator<_Tp>>
  4246.     { static const bool value = true; };
  4247.   template<typename _Tp>
  4248.     const bool __allocator_always_compares_equal<mt_allocator<_Tp>>::value;
  4249.   template<typename> struct new_allocator;
  4250.   template<typename _Tp>
  4251.     struct __allocator_always_compares_equal<new_allocator<_Tp>>
  4252.     { static const bool value = true; };
  4253.   template<typename _Tp>
  4254.     const bool __allocator_always_compares_equal<new_allocator<_Tp>>::value;
  4255.   template<typename> struct pool_allocator;
  4256.   template<typename _Tp>
  4257.     struct __allocator_always_compares_equal<pool_allocator<_Tp>>
  4258.     { static const bool value = true; };
  4259.   template<typename _Tp>
  4260.     const bool __allocator_always_compares_equal<pool_allocator<_Tp>>::value;
  4261. template<typename _Alloc>
  4262.   struct __alloc_traits
  4263.   : std::allocator_traits<_Alloc>
  4264.   {
  4265.     typedef _Alloc allocator_type;
  4266.     typedef std::allocator_traits<_Alloc> _Base_type;
  4267.     typedef typename _Base_type::value_type value_type;
  4268.     typedef typename _Base_type::pointer pointer;
  4269.     typedef typename _Base_type::const_pointer const_pointer;
  4270.     typedef typename _Base_type::size_type size_type;
  4271.     typedef value_type& reference;
  4272.     typedef const value_type& const_reference;
  4273.     using _Base_type::allocate;
  4274.     using _Base_type::deallocate;
  4275.     using _Base_type::construct;
  4276.     using _Base_type::destroy;
  4277.     using _Base_type::max_size;
  4278.   private:
  4279.     template<typename _Ptr>
  4280.       struct __is_custom_pointer
  4281.       : std::integral_constant<bool, std::is_same<pointer, _Ptr>::value
  4282.                                      && !std::is_pointer<_Ptr>::value>
  4283.       { };
  4284.   public:
  4285.     template<typename _Ptr, typename... _Args>
  4286.       static typename std::enable_if<__is_custom_pointer<_Ptr>::value>::type
  4287.       construct(_Alloc& __a, _Ptr __p, _Args&&... __args)
  4288.       {
  4289.  _Base_type::construct(__a, std::addressof(*__p),
  4290.          std::forward<_Args>(__args)...);
  4291.       }
  4292.     template<typename _Ptr>
  4293.       static typename std::enable_if<__is_custom_pointer<_Ptr>::value>::type
  4294.       destroy(_Alloc& __a, _Ptr __p)
  4295.       { _Base_type::destroy(__a, std::addressof(*__p)); }
  4296.     static _Alloc _S_select_on_copy(const _Alloc& __a)
  4297.     { return _Base_type::select_on_container_copy_construction(__a); }
  4298.     static void _S_on_swap(_Alloc& __a, _Alloc& __b)
  4299.     { std::__alloc_on_swap(__a, __b); }
  4300.     static constexpr bool _S_propagate_on_copy_assign()
  4301.     { return _Base_type::propagate_on_container_copy_assignment::value; }
  4302.     static constexpr bool _S_propagate_on_move_assign()
  4303.     { return _Base_type::propagate_on_container_move_assignment::value; }
  4304.     static constexpr bool _S_propagate_on_swap()
  4305.     { return _Base_type::propagate_on_container_swap::value; }
  4306.     static constexpr bool _S_always_equal()
  4307.     { return __allocator_always_compares_equal<_Alloc>::value; }
  4308.     static constexpr bool _S_nothrow_move()
  4309.     { return _S_propagate_on_move_assign() || _S_always_equal(); }
  4310.     static constexpr bool _S_nothrow_swap()
  4311.     {
  4312.       using std::swap;
  4313.       return !_S_propagate_on_swap()
  4314.         || noexcept(swap(std::declval<_Alloc&>(), std::declval<_Alloc&>()));
  4315.     }
  4316.     template<typename _Tp>
  4317.       struct rebind
  4318.       { typedef typename _Base_type::template rebind_alloc<_Tp> other; };
  4319.   };
  4320.  
  4321. }
  4322. namespace std __attribute__ ((__visibility__ ("default")))
  4323. {
  4324.  
  4325.   template<typename _T1, typename... _Args>
  4326.     inline void
  4327.     _Construct(_T1* __p, _Args&&... __args)
  4328.     { ::new(static_cast<void*>(__p)) _T1(std::forward<_Args>(__args)...); }
  4329.   template<typename _Tp>
  4330.     inline void
  4331.     _Destroy(_Tp* __pointer)
  4332.     { __pointer->~_Tp(); }
  4333.   template<bool>
  4334.     struct _Destroy_aux
  4335.     {
  4336.       template<typename _ForwardIterator>
  4337.         static void
  4338.         __destroy(_ForwardIterator __first, _ForwardIterator __last)
  4339.  {
  4340.    for (; __first != __last; ++__first)
  4341.      std::_Destroy(std::__addressof(*__first));
  4342.  }
  4343.     };
  4344.   template<>
  4345.     struct _Destroy_aux<true>
  4346.     {
  4347.       template<typename _ForwardIterator>
  4348.         static void
  4349.         __destroy(_ForwardIterator, _ForwardIterator) { }
  4350.     };
  4351.   template<typename _ForwardIterator>
  4352.     inline void
  4353.     _Destroy(_ForwardIterator __first, _ForwardIterator __last)
  4354.     {
  4355.       typedef typename iterator_traits<_ForwardIterator>::value_type
  4356.                        _Value_type;
  4357.       std::_Destroy_aux<__has_trivial_destructor(_Value_type)>::
  4358.  __destroy(__first, __last);
  4359.     }
  4360.   template <typename _Tp> class allocator;
  4361.   template<typename _ForwardIterator, typename _Allocator>
  4362.     void
  4363.     _Destroy(_ForwardIterator __first, _ForwardIterator __last,
  4364.       _Allocator& __alloc)
  4365.     {
  4366.       typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
  4367.       for (; __first != __last; ++__first)
  4368.  __traits::destroy(__alloc, std::__addressof(*__first));
  4369.     }
  4370.   template<typename _ForwardIterator, typename _Tp>
  4371.     inline void
  4372.     _Destroy(_ForwardIterator __first, _ForwardIterator __last,
  4373.       allocator<_Tp>&)
  4374.     {
  4375.       _Destroy(__first, __last);
  4376.     }
  4377.  
  4378. }
  4379. namespace std __attribute__ ((__visibility__ ("default")))
  4380. {
  4381.  
  4382.   template<bool _TrivialValueTypes>
  4383.     struct __uninitialized_copy
  4384.     {
  4385.       template<typename _InputIterator, typename _ForwardIterator>
  4386.         static _ForwardIterator
  4387.         __uninit_copy(_InputIterator __first, _InputIterator __last,
  4388.         _ForwardIterator __result)
  4389.         {
  4390.    _ForwardIterator __cur = __result;
  4391.    try
  4392.      {
  4393.        for (; __first != __last; ++__first, ++__cur)
  4394.   std::_Construct(std::__addressof(*__cur), *__first);
  4395.        return __cur;
  4396.      }
  4397.    catch(...)
  4398.      {
  4399.        std::_Destroy(__result, __cur);
  4400.        throw;
  4401.      }
  4402.  }
  4403.     };
  4404.   template<>
  4405.     struct __uninitialized_copy<true>
  4406.     {
  4407.       template<typename _InputIterator, typename _ForwardIterator>
  4408.         static _ForwardIterator
  4409.         __uninit_copy(_InputIterator __first, _InputIterator __last,
  4410.         _ForwardIterator __result)
  4411.         { return std::copy(__first, __last, __result); }
  4412.     };
  4413.   template<typename _InputIterator, typename _ForwardIterator>
  4414.     inline _ForwardIterator
  4415.     uninitialized_copy(_InputIterator __first, _InputIterator __last,
  4416.          _ForwardIterator __result)
  4417.     {
  4418.       typedef typename iterator_traits<_InputIterator>::value_type
  4419.  _ValueType1;
  4420.       typedef typename iterator_traits<_ForwardIterator>::value_type
  4421.  _ValueType2;
  4422.       return std::__uninitialized_copy<(__is_trivial(_ValueType1)
  4423.      && __is_trivial(_ValueType2))>::
  4424.  __uninit_copy(__first, __last, __result);
  4425.     }
  4426.   template<bool _TrivialValueType>
  4427.     struct __uninitialized_fill
  4428.     {
  4429.       template<typename _ForwardIterator, typename _Tp>
  4430.         static void
  4431.         __uninit_fill(_ForwardIterator __first, _ForwardIterator __last,
  4432.         const _Tp& __x)
  4433.         {
  4434.    _ForwardIterator __cur = __first;
  4435.    try
  4436.      {
  4437.        for (; __cur != __last; ++__cur)
  4438.   std::_Construct(std::__addressof(*__cur), __x);
  4439.      }
  4440.    catch(...)
  4441.      {
  4442.        std::_Destroy(__first, __cur);
  4443.        throw;
  4444.      }
  4445.  }
  4446.     };
  4447.   template<>
  4448.     struct __uninitialized_fill<true>
  4449.     {
  4450.       template<typename _ForwardIterator, typename _Tp>
  4451.         static void
  4452.         __uninit_fill(_ForwardIterator __first, _ForwardIterator __last,
  4453.         const _Tp& __x)
  4454.         { std::fill(__first, __last, __x); }
  4455.     };
  4456.   template<typename _ForwardIterator, typename _Tp>
  4457.     inline void
  4458.     uninitialized_fill(_ForwardIterator __first, _ForwardIterator __last,
  4459.          const _Tp& __x)
  4460.     {
  4461.       typedef typename iterator_traits<_ForwardIterator>::value_type
  4462.  _ValueType;
  4463.       std::__uninitialized_fill<__is_trivial(_ValueType)>::
  4464.  __uninit_fill(__first, __last, __x);
  4465.     }
  4466.   template<bool _TrivialValueType>
  4467.     struct __uninitialized_fill_n
  4468.     {
  4469.       template<typename _ForwardIterator, typename _Size, typename _Tp>
  4470.         static void
  4471.         __uninit_fill_n(_ForwardIterator __first, _Size __n,
  4472.    const _Tp& __x)
  4473.         {
  4474.    _ForwardIterator __cur = __first;
  4475.    try
  4476.      {
  4477.        for (; __n > 0; --__n, ++__cur)
  4478.   std::_Construct(std::__addressof(*__cur), __x);
  4479.      }
  4480.    catch(...)
  4481.      {
  4482.        std::_Destroy(__first, __cur);
  4483.        throw;
  4484.      }
  4485.  }
  4486.     };
  4487.   template<>
  4488.     struct __uninitialized_fill_n<true>
  4489.     {
  4490.       template<typename _ForwardIterator, typename _Size, typename _Tp>
  4491.         static void
  4492.         __uninit_fill_n(_ForwardIterator __first, _Size __n,
  4493.    const _Tp& __x)
  4494.         { std::fill_n(__first, __n, __x); }
  4495.     };
  4496.   template<typename _ForwardIterator, typename _Size, typename _Tp>
  4497.     inline void
  4498.     uninitialized_fill_n(_ForwardIterator __first, _Size __n, const _Tp& __x)
  4499.     {
  4500.       typedef typename iterator_traits<_ForwardIterator>::value_type
  4501.  _ValueType;
  4502.       std::__uninitialized_fill_n<__is_trivial(_ValueType)>::
  4503.  __uninit_fill_n(__first, __n, __x);
  4504.     }
  4505.   template<typename _InputIterator, typename _ForwardIterator,
  4506.     typename _Allocator>
  4507.     _ForwardIterator
  4508.     __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
  4509.       _ForwardIterator __result, _Allocator& __alloc)
  4510.     {
  4511.       _ForwardIterator __cur = __result;
  4512.       try
  4513.  {
  4514.    typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
  4515.    for (; __first != __last; ++__first, ++__cur)
  4516.      __traits::construct(__alloc, std::__addressof(*__cur), *__first);
  4517.    return __cur;
  4518.  }
  4519.       catch(...)
  4520.  {
  4521.    std::_Destroy(__result, __cur, __alloc);
  4522.    throw;
  4523.  }
  4524.     }
  4525.   template<typename _InputIterator, typename _ForwardIterator, typename _Tp>
  4526.     inline _ForwardIterator
  4527.     __uninitialized_copy_a(_InputIterator __first, _InputIterator __last,
  4528.       _ForwardIterator __result, allocator<_Tp>&)
  4529.     { return std::uninitialized_copy(__first, __last, __result); }
  4530.   template<typename _InputIterator, typename _ForwardIterator,
  4531.     typename _Allocator>
  4532.     inline _ForwardIterator
  4533.     __uninitialized_move_a(_InputIterator __first, _InputIterator __last,
  4534.       _ForwardIterator __result, _Allocator& __alloc)
  4535.     {
  4536.       return std::__uninitialized_copy_a(std::make_move_iterator(__first),
  4537.       std::make_move_iterator(__last),
  4538.       __result, __alloc);
  4539.     }
  4540.   template<typename _InputIterator, typename _ForwardIterator,
  4541.     typename _Allocator>
  4542.     inline _ForwardIterator
  4543.     __uninitialized_move_if_noexcept_a(_InputIterator __first,
  4544.            _InputIterator __last,
  4545.            _ForwardIterator __result,
  4546.            _Allocator& __alloc)
  4547.     {
  4548.       return std::__uninitialized_copy_a
  4549.  (std::__make_move_if_noexcept_iterator(__first),
  4550.   std::__make_move_if_noexcept_iterator(__last), __result, __alloc);
  4551.     }
  4552.   template<typename _ForwardIterator, typename _Tp, typename _Allocator>
  4553.     void
  4554.     __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
  4555.       const _Tp& __x, _Allocator& __alloc)
  4556.     {
  4557.       _ForwardIterator __cur = __first;
  4558.       try
  4559.  {
  4560.    typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
  4561.    for (; __cur != __last; ++__cur)
  4562.      __traits::construct(__alloc, std::__addressof(*__cur), __x);
  4563.  }
  4564.       catch(...)
  4565.  {
  4566.    std::_Destroy(__first, __cur, __alloc);
  4567.    throw;
  4568.  }
  4569.     }
  4570.   template<typename _ForwardIterator, typename _Tp, typename _Tp2>
  4571.     inline void
  4572.     __uninitialized_fill_a(_ForwardIterator __first, _ForwardIterator __last,
  4573.       const _Tp& __x, allocator<_Tp2>&)
  4574.     { std::uninitialized_fill(__first, __last, __x); }
  4575.   template<typename _ForwardIterator, typename _Size, typename _Tp,
  4576.     typename _Allocator>
  4577.     void
  4578.     __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
  4579.         const _Tp& __x, _Allocator& __alloc)
  4580.     {
  4581.       _ForwardIterator __cur = __first;
  4582.       try
  4583.  {
  4584.    typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
  4585.    for (; __n > 0; --__n, ++__cur)
  4586.      __traits::construct(__alloc, std::__addressof(*__cur), __x);
  4587.  }
  4588.       catch(...)
  4589.  {
  4590.    std::_Destroy(__first, __cur, __alloc);
  4591.    throw;
  4592.  }
  4593.     }
  4594.   template<typename _ForwardIterator, typename _Size, typename _Tp,
  4595.     typename _Tp2>
  4596.     inline void
  4597.     __uninitialized_fill_n_a(_ForwardIterator __first, _Size __n,
  4598.         const _Tp& __x, allocator<_Tp2>&)
  4599.     { std::uninitialized_fill_n(__first, __n, __x); }
  4600.   template<typename _InputIterator1, typename _InputIterator2,
  4601.     typename _ForwardIterator, typename _Allocator>
  4602.     inline _ForwardIterator
  4603.     __uninitialized_copy_move(_InputIterator1 __first1,
  4604.          _InputIterator1 __last1,
  4605.          _InputIterator2 __first2,
  4606.          _InputIterator2 __last2,
  4607.          _ForwardIterator __result,
  4608.          _Allocator& __alloc)
  4609.     {
  4610.       _ForwardIterator __mid = std::__uninitialized_copy_a(__first1, __last1,
  4611.           __result,
  4612.           __alloc);
  4613.       try
  4614.  {
  4615.    return std::__uninitialized_move_a(__first2, __last2, __mid, __alloc);
  4616.  }
  4617.       catch(...)
  4618.  {
  4619.    std::_Destroy(__result, __mid, __alloc);
  4620.    throw;
  4621.  }
  4622.     }
  4623.   template<typename _InputIterator1, typename _InputIterator2,
  4624.     typename _ForwardIterator, typename _Allocator>
  4625.     inline _ForwardIterator
  4626.     __uninitialized_move_copy(_InputIterator1 __first1,
  4627.          _InputIterator1 __last1,
  4628.          _InputIterator2 __first2,
  4629.          _InputIterator2 __last2,
  4630.          _ForwardIterator __result,
  4631.          _Allocator& __alloc)
  4632.     {
  4633.       _ForwardIterator __mid = std::__uninitialized_move_a(__first1, __last1,
  4634.           __result,
  4635.           __alloc);
  4636.       try
  4637.  {
  4638.    return std::__uninitialized_copy_a(__first2, __last2, __mid, __alloc);
  4639.  }
  4640.       catch(...)
  4641.  {
  4642.    std::_Destroy(__result, __mid, __alloc);
  4643.    throw;
  4644.  }
  4645.     }
  4646.   template<typename _ForwardIterator, typename _Tp, typename _InputIterator,
  4647.     typename _Allocator>
  4648.     inline _ForwardIterator
  4649.     __uninitialized_fill_move(_ForwardIterator __result, _ForwardIterator __mid,
  4650.          const _Tp& __x, _InputIterator __first,
  4651.          _InputIterator __last, _Allocator& __alloc)
  4652.     {
  4653.       std::__uninitialized_fill_a(__result, __mid, __x, __alloc);
  4654.       try
  4655.  {
  4656.    return std::__uninitialized_move_a(__first, __last, __mid, __alloc);
  4657.  }
  4658.       catch(...)
  4659.  {
  4660.    std::_Destroy(__result, __mid, __alloc);
  4661.    throw;
  4662.  }
  4663.     }
  4664.   template<typename _InputIterator, typename _ForwardIterator, typename _Tp,
  4665.     typename _Allocator>
  4666.     inline void
  4667.     __uninitialized_move_fill(_InputIterator __first1, _InputIterator __last1,
  4668.          _ForwardIterator __first2,
  4669.          _ForwardIterator __last2, const _Tp& __x,
  4670.          _Allocator& __alloc)
  4671.     {
  4672.       _ForwardIterator __mid2 = std::__uninitialized_move_a(__first1, __last1,
  4673.            __first2,
  4674.            __alloc);
  4675.       try
  4676.  {
  4677.    std::__uninitialized_fill_a(__mid2, __last2, __x, __alloc);
  4678.  }
  4679.       catch(...)
  4680.  {
  4681.    std::_Destroy(__first2, __mid2, __alloc);
  4682.    throw;
  4683.  }
  4684.     }
  4685.   template<bool _TrivialValueType>
  4686.     struct __uninitialized_default_1
  4687.     {
  4688.       template<typename _ForwardIterator>
  4689.         static void
  4690.         __uninit_default(_ForwardIterator __first, _ForwardIterator __last)
  4691.         {
  4692.    _ForwardIterator __cur = __first;
  4693.    try
  4694.      {
  4695.        for (; __cur != __last; ++__cur)
  4696.   std::_Construct(std::__addressof(*__cur));
  4697.      }
  4698.    catch(...)
  4699.      {
  4700.        std::_Destroy(__first, __cur);
  4701.        throw;
  4702.      }
  4703.  }
  4704.     };
  4705.   template<>
  4706.     struct __uninitialized_default_1<true>
  4707.     {
  4708.       template<typename _ForwardIterator>
  4709.         static void
  4710.         __uninit_default(_ForwardIterator __first, _ForwardIterator __last)
  4711.         {
  4712.    typedef typename iterator_traits<_ForwardIterator>::value_type
  4713.      _ValueType;
  4714.    std::fill(__first, __last, _ValueType());
  4715.  }
  4716.     };
  4717.   template<bool _TrivialValueType>
  4718.     struct __uninitialized_default_n_1
  4719.     {
  4720.       template<typename _ForwardIterator, typename _Size>
  4721.         static void
  4722.         __uninit_default_n(_ForwardIterator __first, _Size __n)
  4723.         {
  4724.    _ForwardIterator __cur = __first;
  4725.    try
  4726.      {
  4727.        for (; __n > 0; --__n, ++__cur)
  4728.   std::_Construct(std::__addressof(*__cur));
  4729.      }
  4730.    catch(...)
  4731.      {
  4732.        std::_Destroy(__first, __cur);
  4733.        throw;
  4734.      }
  4735.  }
  4736.     };
  4737.   template<>
  4738.     struct __uninitialized_default_n_1<true>
  4739.     {
  4740.       template<typename _ForwardIterator, typename _Size>
  4741.         static void
  4742.         __uninit_default_n(_ForwardIterator __first, _Size __n)
  4743.         {
  4744.    typedef typename iterator_traits<_ForwardIterator>::value_type
  4745.      _ValueType;
  4746.    std::fill_n(__first, __n, _ValueType());
  4747.  }
  4748.     };
  4749.   template<typename _ForwardIterator>
  4750.     inline void
  4751.     __uninitialized_default(_ForwardIterator __first,
  4752.        _ForwardIterator __last)
  4753.     {
  4754.       typedef typename iterator_traits<_ForwardIterator>::value_type
  4755.  _ValueType;
  4756.       std::__uninitialized_default_1<__is_trivial(_ValueType)>::
  4757.  __uninit_default(__first, __last);
  4758.     }
  4759.   template<typename _ForwardIterator, typename _Size>
  4760.     inline void
  4761.     __uninitialized_default_n(_ForwardIterator __first, _Size __n)
  4762.     {
  4763.       typedef typename iterator_traits<_ForwardIterator>::value_type
  4764.  _ValueType;
  4765.       std::__uninitialized_default_n_1<__is_trivial(_ValueType)>::
  4766.  __uninit_default_n(__first, __n);
  4767.     }
  4768.   template<typename _ForwardIterator, typename _Allocator>
  4769.     void
  4770.     __uninitialized_default_a(_ForwardIterator __first,
  4771.          _ForwardIterator __last,
  4772.          _Allocator& __alloc)
  4773.     {
  4774.       _ForwardIterator __cur = __first;
  4775.       try
  4776.  {
  4777.    typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
  4778.    for (; __cur != __last; ++__cur)
  4779.      __traits::construct(__alloc, std::__addressof(*__cur));
  4780.  }
  4781.       catch(...)
  4782.  {
  4783.    std::_Destroy(__first, __cur, __alloc);
  4784.    throw;
  4785.  }
  4786.     }
  4787.   template<typename _ForwardIterator, typename _Tp>
  4788.     inline void
  4789.     __uninitialized_default_a(_ForwardIterator __first,
  4790.          _ForwardIterator __last,
  4791.          allocator<_Tp>&)
  4792.     { std::__uninitialized_default(__first, __last); }
  4793.   template<typename _ForwardIterator, typename _Size, typename _Allocator>
  4794.     void
  4795.     __uninitialized_default_n_a(_ForwardIterator __first, _Size __n,
  4796.     _Allocator& __alloc)
  4797.     {
  4798.       _ForwardIterator __cur = __first;
  4799.       try
  4800.  {
  4801.    typedef __gnu_cxx::__alloc_traits<_Allocator> __traits;
  4802.    for (; __n > 0; --__n, ++__cur)
  4803.      __traits::construct(__alloc, std::__addressof(*__cur));
  4804.  }
  4805.       catch(...)
  4806.  {
  4807.    std::_Destroy(__first, __cur, __alloc);
  4808.    throw;
  4809.  }
  4810.     }
  4811.   template<typename _ForwardIterator, typename _Size, typename _Tp>
  4812.     inline void
  4813.     __uninitialized_default_n_a(_ForwardIterator __first, _Size __n,
  4814.     allocator<_Tp>&)
  4815.     { std::__uninitialized_default_n(__first, __n); }
  4816.   template<typename _InputIterator, typename _Size,
  4817.     typename _ForwardIterator>
  4818.     _ForwardIterator
  4819.     __uninitialized_copy_n(_InputIterator __first, _Size __n,
  4820.       _ForwardIterator __result, input_iterator_tag)
  4821.     {
  4822.       _ForwardIterator __cur = __result;
  4823.       try
  4824.  {
  4825.    for (; __n > 0; --__n, ++__first, ++__cur)
  4826.      std::_Construct(std::__addressof(*__cur), *__first);
  4827.    return __cur;
  4828.  }
  4829.       catch(...)
  4830.  {
  4831.    std::_Destroy(__result, __cur);
  4832.    throw;
  4833.  }
  4834.     }
  4835.   template<typename _RandomAccessIterator, typename _Size,
  4836.     typename _ForwardIterator>
  4837.     inline _ForwardIterator
  4838.     __uninitialized_copy_n(_RandomAccessIterator __first, _Size __n,
  4839.       _ForwardIterator __result,
  4840.       random_access_iterator_tag)
  4841.     { return std::uninitialized_copy(__first, __first + __n, __result); }
  4842.   template<typename _InputIterator, typename _Size, typename _ForwardIterator>
  4843.     inline _ForwardIterator
  4844.     uninitialized_copy_n(_InputIterator __first, _Size __n,
  4845.     _ForwardIterator __result)
  4846.     { return std::__uninitialized_copy_n(__first, __n, __result,
  4847.       std::__iterator_category(__first)); }
  4848.  
  4849. }
  4850. namespace std __attribute__ ((__visibility__ ("default")))
  4851. {
  4852.  
  4853.   template<typename _Tp>
  4854.     pair<_Tp*, ptrdiff_t>
  4855.     get_temporary_buffer(ptrdiff_t __len) noexcept
  4856.     {
  4857.       const ptrdiff_t __max =
  4858.  __gnu_cxx::__numeric_traits<ptrdiff_t>::__max / sizeof(_Tp);
  4859.       if (__len > __max)
  4860.  __len = __max;
  4861.       while (__len > 0)
  4862.  {
  4863.    _Tp* __tmp = static_cast<_Tp*>(::operator new(__len * sizeof(_Tp),
  4864.        std::nothrow));
  4865.    if (__tmp != 0)
  4866.      return std::pair<_Tp*, ptrdiff_t>(__tmp, __len);
  4867.    __len /= 2;
  4868.  }
  4869.       return std::pair<_Tp*, ptrdiff_t>(static_cast<_Tp*>(0), 0);
  4870.     }
  4871.   template<typename _Tp>
  4872.     inline void
  4873.     return_temporary_buffer(_Tp* __p)
  4874.     { ::operator delete(__p, std::nothrow); }
  4875.   template<typename _ForwardIterator, typename _Tp>
  4876.     class _Temporary_buffer
  4877.     {
  4878.      
  4879.     public:
  4880.       typedef _Tp value_type;
  4881.       typedef value_type* pointer;
  4882.       typedef pointer iterator;
  4883.       typedef ptrdiff_t size_type;
  4884.     protected:
  4885.       size_type _M_original_len;
  4886.       size_type _M_len;
  4887.       pointer _M_buffer;
  4888.     public:
  4889.       size_type
  4890.       size() const
  4891.       { return _M_len; }
  4892.       size_type
  4893.       requested_size() const
  4894.       { return _M_original_len; }
  4895.       iterator
  4896.       begin()
  4897.       { return _M_buffer; }
  4898.       iterator
  4899.       end()
  4900.       { return _M_buffer + _M_len; }
  4901.       _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last);
  4902.       ~_Temporary_buffer()
  4903.       {
  4904.  std::_Destroy(_M_buffer, _M_buffer + _M_len);
  4905.  std::return_temporary_buffer(_M_buffer);
  4906.       }
  4907.     private:
  4908.       _Temporary_buffer(const _Temporary_buffer&);
  4909.       void
  4910.       operator=(const _Temporary_buffer&);
  4911.     };
  4912.   template<bool>
  4913.     struct __uninitialized_construct_buf_dispatch
  4914.     {
  4915.       template<typename _ForwardIterator, typename _Tp>
  4916.         static void
  4917.         __ucr(_ForwardIterator __first, _ForwardIterator __last,
  4918.        _Tp& __value)
  4919.         {
  4920.    if(__first == __last)
  4921.      return;
  4922.    _ForwardIterator __cur = __first;
  4923.    try
  4924.      {
  4925.        std::_Construct(std::__addressof(*__first),
  4926.          std::move(__value));
  4927.        _ForwardIterator __prev = __cur;
  4928.        ++__cur;
  4929.        for(; __cur != __last; ++__cur, ++__prev)
  4930.   std::_Construct(std::__addressof(*__cur),
  4931.     std::move(*__prev));
  4932.        __value = std::move(*__prev);
  4933.      }
  4934.    catch(...)
  4935.      {
  4936.        std::_Destroy(__first, __cur);
  4937.        throw;
  4938.      }
  4939.  }
  4940.     };
  4941.   template<>
  4942.     struct __uninitialized_construct_buf_dispatch<true>
  4943.     {
  4944.       template<typename _ForwardIterator, typename _Tp>
  4945.         static void
  4946.         __ucr(_ForwardIterator, _ForwardIterator, _Tp&) { }
  4947.     };
  4948.   template<typename _ForwardIterator, typename _Tp>
  4949.     inline void
  4950.     __uninitialized_construct_buf(_ForwardIterator __first,
  4951.       _ForwardIterator __last,
  4952.       _Tp& __value)
  4953.     {
  4954.       typedef typename std::iterator_traits<_ForwardIterator>::value_type
  4955.  _ValueType;
  4956.       std::__uninitialized_construct_buf_dispatch<
  4957.         __has_trivial_constructor(_ValueType)>::
  4958.    __ucr(__first, __last, __value);
  4959.     }
  4960.   template<typename _ForwardIterator, typename _Tp>
  4961.     _Temporary_buffer<_ForwardIterator, _Tp>::
  4962.     _Temporary_buffer(_ForwardIterator __first, _ForwardIterator __last)
  4963.     : _M_original_len(std::distance(__first, __last)),
  4964.       _M_len(0), _M_buffer(0)
  4965.     {
  4966.       try
  4967.  {
  4968.    std::pair<pointer, size_type> __p(std::get_temporary_buffer<
  4969.          value_type>(_M_original_len));
  4970.    _M_buffer = __p.first;
  4971.    _M_len = __p.second;
  4972.    if(_M_buffer)
  4973.      std::__uninitialized_construct_buf(_M_buffer, _M_buffer + _M_len,
  4974.             *__first);
  4975.  }
  4976.       catch(...)
  4977.  {
  4978.    std::return_temporary_buffer(_M_buffer);
  4979.    _M_buffer = 0;
  4980.    _M_len = 0;
  4981.    throw;
  4982.  }
  4983.     }
  4984.  
  4985. }
  4986. namespace std __attribute__ ((__visibility__ ("default")))
  4987. {
  4988.  
  4989.   template <class _OutputIterator, class _Tp>
  4990.     class raw_storage_iterator
  4991.     : public iterator<output_iterator_tag, void, void, void, void>
  4992.     {
  4993.     protected:
  4994.       _OutputIterator _M_iter;
  4995.     public:
  4996.       explicit
  4997.       raw_storage_iterator(_OutputIterator __x)
  4998.       : _M_iter(__x) {}
  4999.       raw_storage_iterator&
  5000.       operator*() { return *this; }
  5001.       raw_storage_iterator&
  5002.       operator=(const _Tp& __element)
  5003.       {
  5004.  std::_Construct(std::__addressof(*_M_iter), __element);
  5005.  return *this;
  5006.       }
  5007.       raw_storage_iterator<_OutputIterator, _Tp>&
  5008.       operator++()
  5009.       {
  5010.  ++_M_iter;
  5011.  return *this;
  5012.       }
  5013.       raw_storage_iterator<_OutputIterator, _Tp>
  5014.       operator++(int)
  5015.       {
  5016.  raw_storage_iterator<_OutputIterator, _Tp> __tmp = *this;
  5017.  ++_M_iter;
  5018.  return __tmp;
  5019.       }
  5020.     };
  5021.  
  5022. }
  5023.        
  5024.        
  5025. namespace std
  5026. {
  5027.  
  5028.   size_t
  5029.   _Hash_bytes(const void* __ptr, size_t __len, size_t __seed);
  5030.   size_t
  5031.   _Fnv_hash_bytes(const void* __ptr, size_t __len, size_t __seed);
  5032.  
  5033. }
  5034. #pragma GCC visibility push(default)
  5035. extern "C++" {
  5036. namespace __cxxabiv1
  5037. {
  5038.   class __class_type_info;
  5039. }
  5040. namespace std
  5041. {
  5042.   class type_info
  5043.   {
  5044.   public:
  5045.     virtual ~type_info();
  5046.     const char* name() const
  5047.     { return __name[0] == '*' ? __name + 1 : __name; }
  5048.     bool before(const type_info& __arg) const
  5049.     { return (__name[0] == '*' && __arg.__name[0] == '*')
  5050.  ? __name < __arg.__name
  5051.  : __builtin_strcmp (__name, __arg.__name) < 0; }
  5052.     bool operator==(const type_info& __arg) const
  5053.     {
  5054.       return ((__name == __arg.__name)
  5055.        || (__name[0] != '*' &&
  5056.     __builtin_strcmp (__name, __arg.__name) == 0));
  5057.     }
  5058.     bool operator!=(const type_info& __arg) const
  5059.     { return !operator==(__arg); }
  5060.     size_t hash_code() const noexcept
  5061.     {
  5062.       return _Hash_bytes(name(), __builtin_strlen(name()),
  5063.     static_cast<size_t>(0xc70f6907UL));
  5064.     }
  5065.     virtual bool __is_pointer_p() const;
  5066.     virtual bool __is_function_p() const;
  5067.     virtual bool __do_catch(const type_info *__thr_type, void **__thr_obj,
  5068.        unsigned __outer) const;
  5069.     virtual bool __do_upcast(const __cxxabiv1::__class_type_info *__target,
  5070.         void **__obj_ptr) const;
  5071.   protected:
  5072.     const char *__name;
  5073.     explicit type_info(const char *__n): __name(__n) { }
  5074.   private:
  5075.     type_info& operator=(const type_info&);
  5076.     type_info(const type_info&);
  5077.   };
  5078.   class bad_cast : public exception
  5079.   {
  5080.   public:
  5081.     bad_cast() noexcept { }
  5082.     virtual ~bad_cast() noexcept;
  5083.     virtual const char* what() const noexcept;
  5084.   };
  5085.   class bad_typeid : public exception
  5086.   {
  5087.   public:
  5088.     bad_typeid () noexcept { }
  5089.     virtual ~bad_typeid() noexcept;
  5090.     virtual const char* what() const noexcept;
  5091.   };
  5092. }
  5093. }
  5094. #pragma GCC visibility pop
  5095.        
  5096.        
  5097. namespace std __attribute__ ((__visibility__ ("default")))
  5098. {
  5099.  
  5100.   template<typename _Alloc>
  5101.     class allocator;
  5102.   template<class _CharT>
  5103.     struct char_traits;
  5104.   template<typename _CharT, typename _Traits = char_traits<_CharT>,
  5105.            typename _Alloc = allocator<_CharT> >
  5106.     class basic_string;
  5107.   template<> struct char_traits<char>;
  5108.   typedef basic_string<char> string;
  5109.   template<> struct char_traits<wchar_t>;
  5110.   typedef basic_string<wchar_t> wstring;
  5111.   template<> struct char_traits<char16_t>;
  5112.   template<> struct char_traits<char32_t>;
  5113.   typedef basic_string<char16_t> u16string;
  5114.   typedef basic_string<char32_t> u32string;
  5115.  
  5116. }
  5117.        
  5118.        
  5119. struct _IO_FILE;
  5120.  
  5121. typedef struct _IO_FILE FILE;
  5122.  
  5123.  
  5124. typedef struct _IO_FILE __FILE;
  5125. typedef __builtin_va_list __gnuc_va_list;
  5126. typedef long unsigned int size_t;
  5127. typedef unsigned int wint_t;
  5128. typedef struct
  5129. {
  5130.   int __count;
  5131.   union
  5132.   {
  5133.     unsigned int __wch;
  5134.     char __wchb[4];
  5135.   } __value;
  5136. } __mbstate_t;
  5137.  
  5138. typedef __mbstate_t mbstate_t;
  5139.  
  5140.  
  5141. extern "C" {
  5142.  
  5143. struct tm;
  5144.  
  5145.  
  5146.  
  5147. extern wchar_t *wcscpy (wchar_t *__restrict __dest,
  5148.    __const wchar_t *__restrict __src) throw ();
  5149. extern wchar_t *wcsncpy (wchar_t *__restrict __dest,
  5150.     __const wchar_t *__restrict __src, size_t __n)
  5151.      throw ();
  5152. extern wchar_t *wcscat (wchar_t *__restrict __dest,
  5153.    __const wchar_t *__restrict __src) throw ();
  5154. extern wchar_t *wcsncat (wchar_t *__restrict __dest,
  5155.     __const wchar_t *__restrict __src, size_t __n)
  5156.      throw ();
  5157. extern int wcscmp (__const wchar_t *__s1, __const wchar_t *__s2)
  5158.      throw () __attribute__ ((__pure__));
  5159. extern int wcsncmp (__const wchar_t *__s1, __const wchar_t *__s2, size_t __n)
  5160.      throw () __attribute__ ((__pure__));
  5161.  
  5162. extern int wcscasecmp (__const wchar_t *__s1, __const wchar_t *__s2) throw ();
  5163. extern int wcsncasecmp (__const wchar_t *__s1, __const wchar_t *__s2,
  5164.    size_t __n) throw ();
  5165. typedef struct __locale_struct
  5166. {
  5167.   struct __locale_data *__locales[13];
  5168.   const unsigned short int *__ctype_b;
  5169.   const int *__ctype_tolower;
  5170.   const int *__ctype_toupper;
  5171.   const char *__names[13];
  5172. } *__locale_t;
  5173. typedef __locale_t locale_t;
  5174. extern int wcscasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
  5175.     __locale_t __loc) throw ();
  5176. extern int wcsncasecmp_l (__const wchar_t *__s1, __const wchar_t *__s2,
  5177.      size_t __n, __locale_t __loc) throw ();
  5178.  
  5179. extern int wcscoll (__const wchar_t *__s1, __const wchar_t *__s2) throw ();
  5180. extern size_t wcsxfrm (wchar_t *__restrict __s1,
  5181.          __const wchar_t *__restrict __s2, size_t __n) throw ();
  5182.  
  5183. extern int wcscoll_l (__const wchar_t *__s1, __const wchar_t *__s2,
  5184.         __locale_t __loc) throw ();
  5185. extern size_t wcsxfrm_l (wchar_t *__s1, __const wchar_t *__s2,
  5186.     size_t __n, __locale_t __loc) throw ();
  5187. extern wchar_t *wcsdup (__const wchar_t *__s) throw () __attribute__ ((__malloc__));
  5188.  
  5189. extern "C++" wchar_t *wcschr (wchar_t *__wcs, wchar_t __wc)
  5190.      throw () __asm ("wcschr") __attribute__ ((__pure__));
  5191. extern "C++" __const wchar_t *wcschr (__const wchar_t *__wcs, wchar_t __wc)
  5192.      throw () __asm ("wcschr") __attribute__ ((__pure__));
  5193. extern "C++" wchar_t *wcsrchr (wchar_t *__wcs, wchar_t __wc)
  5194.      throw () __asm ("wcsrchr") __attribute__ ((__pure__));
  5195. extern "C++" __const wchar_t *wcsrchr (__const wchar_t *__wcs, wchar_t __wc)
  5196.      throw () __asm ("wcsrchr") __attribute__ ((__pure__));
  5197.  
  5198. extern wchar_t *wcschrnul (__const wchar_t *__s, wchar_t __wc)
  5199.      throw () __attribute__ ((__pure__));
  5200.  
  5201. extern size_t wcscspn (__const wchar_t *__wcs, __const wchar_t *__reject)
  5202.      throw () __attribute__ ((__pure__));
  5203. extern size_t wcsspn (__const wchar_t *__wcs, __const wchar_t *__accept)
  5204.      throw () __attribute__ ((__pure__));
  5205. extern "C++" wchar_t *wcspbrk (wchar_t *__wcs, __const wchar_t *__accept)
  5206.      throw () __asm ("wcspbrk") __attribute__ ((__pure__));
  5207. extern "C++" __const wchar_t *wcspbrk (__const wchar_t *__wcs,
  5208.            __const wchar_t *__accept)
  5209.      throw () __asm ("wcspbrk") __attribute__ ((__pure__));
  5210. extern "C++" wchar_t *wcsstr (wchar_t *__haystack, __const wchar_t *__needle)
  5211.      throw () __asm ("wcsstr") __attribute__ ((__pure__));
  5212. extern "C++" __const wchar_t *wcsstr (__const wchar_t *__haystack,
  5213.           __const wchar_t *__needle)
  5214.      throw () __asm ("wcsstr") __attribute__ ((__pure__));
  5215. extern wchar_t *wcstok (wchar_t *__restrict __s,
  5216.    __const wchar_t *__restrict __delim,
  5217.    wchar_t **__restrict __ptr) throw ();
  5218. extern size_t wcslen (__const wchar_t *__s) throw () __attribute__ ((__pure__));
  5219.  
  5220. extern "C++" wchar_t *wcswcs (wchar_t *__haystack, __const wchar_t *__needle)
  5221.      throw () __asm ("wcswcs") __attribute__ ((__pure__));
  5222. extern "C++" __const wchar_t *wcswcs (__const wchar_t *__haystack,
  5223.           __const wchar_t *__needle)
  5224.      throw () __asm ("wcswcs") __attribute__ ((__pure__));
  5225. extern size_t wcsnlen (__const wchar_t *__s, size_t __maxlen)
  5226.      throw () __attribute__ ((__pure__));
  5227.  
  5228. extern "C++" wchar_t *wmemchr (wchar_t *__s, wchar_t __c, size_t __n)
  5229.      throw () __asm ("wmemchr") __attribute__ ((__pure__));
  5230. extern "C++" __const wchar_t *wmemchr (__const wchar_t *__s, wchar_t __c,
  5231.            size_t __n)
  5232.      throw () __asm ("wmemchr") __attribute__ ((__pure__));
  5233. extern int wmemcmp (__const wchar_t *__restrict __s1,
  5234.       __const wchar_t *__restrict __s2, size_t __n)
  5235.      throw () __attribute__ ((__pure__));
  5236. extern wchar_t *wmemcpy (wchar_t *__restrict __s1,
  5237.     __const wchar_t *__restrict __s2, size_t __n) throw ();
  5238. extern wchar_t *wmemmove (wchar_t *__s1, __const wchar_t *__s2, size_t __n)
  5239.      throw ();
  5240. extern wchar_t *wmemset (wchar_t *__s, wchar_t __c, size_t __n) throw ();
  5241.  
  5242. extern wchar_t *wmempcpy (wchar_t *__restrict __s1,
  5243.      __const wchar_t *__restrict __s2, size_t __n)
  5244.      throw ();
  5245.  
  5246. extern wint_t btowc (int __c) throw ();
  5247. extern int wctob (wint_t __c) throw ();
  5248. extern int mbsinit (__const mbstate_t *__ps) throw () __attribute__ ((__pure__));
  5249. extern size_t mbrtowc (wchar_t *__restrict __pwc,
  5250.          __const char *__restrict __s, size_t __n,
  5251.          mbstate_t *__p) throw ();
  5252. extern size_t wcrtomb (char *__restrict __s, wchar_t __wc,
  5253.          mbstate_t *__restrict __ps) throw ();
  5254. extern size_t __mbrlen (__const char *__restrict __s, size_t __n,
  5255.    mbstate_t *__restrict __ps) throw ();
  5256. extern size_t mbrlen (__const char *__restrict __s, size_t __n,
  5257.         mbstate_t *__restrict __ps) throw ();
  5258.  
  5259.  
  5260. extern size_t mbsrtowcs (wchar_t *__restrict __dst,
  5261.     __const char **__restrict __src, size_t __len,
  5262.     mbstate_t *__restrict __ps) throw ();
  5263. extern size_t wcsrtombs (char *__restrict __dst,
  5264.     __const wchar_t **__restrict __src, size_t __len,
  5265.     mbstate_t *__restrict __ps) throw ();
  5266.  
  5267. extern size_t mbsnrtowcs (wchar_t *__restrict __dst,
  5268.      __const char **__restrict __src, size_t __nmc,
  5269.      size_t __len, mbstate_t *__restrict __ps) throw ();
  5270. extern size_t wcsnrtombs (char *__restrict __dst,
  5271.      __const wchar_t **__restrict __src,
  5272.      size_t __nwc, size_t __len,
  5273.      mbstate_t *__restrict __ps) throw ();
  5274. extern int wcwidth (wchar_t __c) throw ();
  5275. extern int wcswidth (__const wchar_t *__s, size_t __n) throw ();
  5276.  
  5277. extern double wcstod (__const wchar_t *__restrict __nptr,
  5278.         wchar_t **__restrict __endptr) throw ();
  5279.  
  5280.  
  5281. extern float wcstof (__const wchar_t *__restrict __nptr,
  5282.        wchar_t **__restrict __endptr) throw ();
  5283. extern long double wcstold (__const wchar_t *__restrict __nptr,
  5284.        wchar_t **__restrict __endptr) throw ();
  5285.  
  5286.  
  5287. extern long int wcstol (__const wchar_t *__restrict __nptr,
  5288.    wchar_t **__restrict __endptr, int __base) throw ();
  5289. extern unsigned long int wcstoul (__const wchar_t *__restrict __nptr,
  5290.       wchar_t **__restrict __endptr, int __base)
  5291.      throw ();
  5292.  
  5293.  
  5294. __extension__
  5295. extern long long int wcstoll (__const wchar_t *__restrict __nptr,
  5296.          wchar_t **__restrict __endptr, int __base)
  5297.      throw ();
  5298. __extension__
  5299. extern unsigned long long int wcstoull (__const wchar_t *__restrict __nptr,
  5300.      wchar_t **__restrict __endptr,
  5301.      int __base) throw ();
  5302.  
  5303. __extension__
  5304. extern long long int wcstoq (__const wchar_t *__restrict __nptr,
  5305.         wchar_t **__restrict __endptr, int __base)
  5306.      throw ();
  5307. __extension__
  5308. extern unsigned long long int wcstouq (__const wchar_t *__restrict __nptr,
  5309.            wchar_t **__restrict __endptr,
  5310.            int __base) throw ();
  5311. extern long int wcstol_l (__const wchar_t *__restrict __nptr,
  5312.      wchar_t **__restrict __endptr, int __base,
  5313.      __locale_t __loc) throw ();
  5314. extern unsigned long int wcstoul_l (__const wchar_t *__restrict __nptr,
  5315.         wchar_t **__restrict __endptr,
  5316.         int __base, __locale_t __loc) throw ();
  5317. __extension__
  5318. extern long long int wcstoll_l (__const wchar_t *__restrict __nptr,
  5319.     wchar_t **__restrict __endptr,
  5320.     int __base, __locale_t __loc) throw ();
  5321. __extension__
  5322. extern unsigned long long int wcstoull_l (__const wchar_t *__restrict __nptr,
  5323.        wchar_t **__restrict __endptr,
  5324.        int __base, __locale_t __loc)
  5325.      throw ();
  5326. extern double wcstod_l (__const wchar_t *__restrict __nptr,
  5327.    wchar_t **__restrict __endptr, __locale_t __loc)
  5328.      throw ();
  5329. extern float wcstof_l (__const wchar_t *__restrict __nptr,
  5330.          wchar_t **__restrict __endptr, __locale_t __loc)
  5331.      throw ();
  5332. extern long double wcstold_l (__const wchar_t *__restrict __nptr,
  5333.          wchar_t **__restrict __endptr,
  5334.          __locale_t __loc) throw ();
  5335. extern wchar_t *wcpcpy (wchar_t *__restrict __dest,
  5336.    __const wchar_t *__restrict __src) throw ();
  5337. extern wchar_t *wcpncpy (wchar_t *__restrict __dest,
  5338.     __const wchar_t *__restrict __src, size_t __n)
  5339.      throw ();
  5340. extern __FILE *open_wmemstream (wchar_t **__bufloc, size_t *__sizeloc) throw ();
  5341.  
  5342. extern int fwide (__FILE *__fp, int __mode) throw ();
  5343. extern int fwprintf (__FILE *__restrict __stream,
  5344.        __const wchar_t *__restrict __format, ...)
  5345.                                                            ;
  5346. extern int wprintf (__const wchar_t *__restrict __format, ...)
  5347.                                                            ;
  5348. extern int swprintf (wchar_t *__restrict __s, size_t __n,
  5349.        __const wchar_t *__restrict __format, ...)
  5350.      throw () ;
  5351. extern int vfwprintf (__FILE *__restrict __s,
  5352.         __const wchar_t *__restrict __format,
  5353.         __gnuc_va_list __arg)
  5354.                                                            ;
  5355. extern int vwprintf (__const wchar_t *__restrict __format,
  5356.        __gnuc_va_list __arg)
  5357.                                                            ;
  5358. extern int vswprintf (wchar_t *__restrict __s, size_t __n,
  5359.         __const wchar_t *__restrict __format,
  5360.         __gnuc_va_list __arg)
  5361.      throw () ;
  5362. extern int fwscanf (__FILE *__restrict __stream,
  5363.       __const wchar_t *__restrict __format, ...)
  5364.                                                           ;
  5365. extern int wscanf (__const wchar_t *__restrict __format, ...)
  5366.                                                           ;
  5367. extern int swscanf (__const wchar_t *__restrict __s,
  5368.       __const wchar_t *__restrict __format, ...)
  5369.      throw () ;
  5370.  
  5371.  
  5372. extern int vfwscanf (__FILE *__restrict __s,
  5373.        __const wchar_t *__restrict __format,
  5374.        __gnuc_va_list __arg)
  5375.                                                           ;
  5376. extern int vwscanf (__const wchar_t *__restrict __format,
  5377.       __gnuc_va_list __arg)
  5378.                                                           ;
  5379. extern int vswscanf (__const wchar_t *__restrict __s,
  5380.        __const wchar_t *__restrict __format,
  5381.        __gnuc_va_list __arg)
  5382.      throw () ;
  5383.  
  5384.  
  5385. extern wint_t fgetwc (__FILE *__stream);
  5386. extern wint_t getwc (__FILE *__stream);
  5387. extern wint_t getwchar (void);
  5388. extern wint_t fputwc (wchar_t __wc, __FILE *__stream);
  5389. extern wint_t putwc (wchar_t __wc, __FILE *__stream);
  5390. extern wint_t putwchar (wchar_t __wc);
  5391. extern wchar_t *fgetws (wchar_t *__restrict __ws, int __n,
  5392.    __FILE *__restrict __stream);
  5393. extern int fputws (__const wchar_t *__restrict __ws,
  5394.      __FILE *__restrict __stream);
  5395. extern wint_t ungetwc (wint_t __wc, __FILE *__stream);
  5396.  
  5397. extern wint_t getwc_unlocked (__FILE *__stream);
  5398. extern wint_t getwchar_unlocked (void);
  5399. extern wint_t fgetwc_unlocked (__FILE *__stream);
  5400. extern wint_t fputwc_unlocked (wchar_t __wc, __FILE *__stream);
  5401. extern wint_t putwc_unlocked (wchar_t __wc, __FILE *__stream);
  5402. extern wint_t putwchar_unlocked (wchar_t __wc);
  5403. extern wchar_t *fgetws_unlocked (wchar_t *__restrict __ws, int __n,
  5404.      __FILE *__restrict __stream);
  5405. extern int fputws_unlocked (__const wchar_t *__restrict __ws,
  5406.        __FILE *__restrict __stream);
  5407.  
  5408. extern size_t wcsftime (wchar_t *__restrict __s, size_t __maxsize,
  5409.    __const wchar_t *__restrict __format,
  5410.    __const struct tm *__restrict __tp) throw ();
  5411.  
  5412. extern size_t wcsftime_l (wchar_t *__restrict __s, size_t __maxsize,
  5413.      __const wchar_t *__restrict __format,
  5414.      __const struct tm *__restrict __tp,
  5415.      __locale_t __loc) throw ();
  5416. }
  5417. namespace std
  5418. {
  5419.   using ::mbstate_t;
  5420. }
  5421. namespace std __attribute__ ((__visibility__ ("default")))
  5422. {
  5423.  
  5424.   using ::wint_t;
  5425.   using ::btowc;
  5426.   using ::fgetwc;
  5427.   using ::fgetws;
  5428.   using ::fputwc;
  5429.   using ::fputws;
  5430.   using ::fwide;
  5431.   using ::fwprintf;
  5432.   using ::fwscanf;
  5433.   using ::getwc;
  5434.   using ::getwchar;
  5435.   using ::mbrlen;
  5436.   using ::mbrtowc;
  5437.   using ::mbsinit;
  5438.   using ::mbsrtowcs;
  5439.   using ::putwc;
  5440.   using ::putwchar;
  5441.   using ::swprintf;
  5442.   using ::swscanf;
  5443.   using ::ungetwc;
  5444.   using ::vfwprintf;
  5445.   using ::vfwscanf;
  5446.   using ::vswprintf;
  5447.   using ::vswscanf;
  5448.   using ::vwprintf;
  5449.   using ::vwscanf;
  5450.   using ::wcrtomb;
  5451.   using ::wcscat;
  5452.   using ::wcscmp;
  5453.   using ::wcscoll;
  5454.   using ::wcscpy;
  5455.   using ::wcscspn;
  5456.   using ::wcsftime;
  5457.   using ::wcslen;
  5458.   using ::wcsncat;
  5459.   using ::wcsncmp;
  5460.   using ::wcsncpy;
  5461.   using ::wcsrtombs;
  5462.   using ::wcsspn;
  5463.   using ::wcstod;
  5464.   using ::wcstof;
  5465.   using ::wcstok;
  5466.   using ::wcstol;
  5467.   using ::wcstoul;
  5468.   using ::wcsxfrm;
  5469.   using ::wctob;
  5470.   using ::wmemcmp;
  5471.   using ::wmemcpy;
  5472.   using ::wmemmove;
  5473.   using ::wmemset;
  5474.   using ::wprintf;
  5475.   using ::wscanf;
  5476.   using ::wcschr;
  5477.   using ::wcspbrk;
  5478.   using ::wcsrchr;
  5479.   using ::wcsstr;
  5480.   using ::wmemchr;
  5481.  
  5482. }
  5483. namespace __gnu_cxx
  5484. {
  5485.   using ::wcstold;
  5486.   using ::wcstoll;
  5487.   using ::wcstoull;
  5488. }
  5489. namespace std
  5490. {
  5491.   using ::__gnu_cxx::wcstold;
  5492.   using ::__gnu_cxx::wcstoll;
  5493.   using ::__gnu_cxx::wcstoull;
  5494. }
  5495. namespace std
  5496. {
  5497.   using std::wcstof;
  5498.   using std::vfwscanf;
  5499.   using std::vswscanf;
  5500.   using std::vwscanf;
  5501.   using std::wcstold;
  5502.   using std::wcstoll;
  5503.   using std::wcstoull;
  5504. }
  5505. namespace std __attribute__ ((__visibility__ ("default")))
  5506. {
  5507.  
  5508.   typedef long streamoff;
  5509.   typedef ptrdiff_t streamsize;
  5510.   template<typename _StateT>
  5511.     class fpos
  5512.     {
  5513.     private:
  5514.       streamoff _M_off;
  5515.       _StateT _M_state;
  5516.     public:
  5517.       fpos()
  5518.       : _M_off(0), _M_state() { }
  5519.       fpos(streamoff __off)
  5520.       : _M_off(__off), _M_state() { }
  5521.       operator streamoff() const { return _M_off; }
  5522.       void
  5523.       state(_StateT __st)
  5524.       { _M_state = __st; }
  5525.       _StateT
  5526.       state() const
  5527.       { return _M_state; }
  5528.       fpos&
  5529.       operator+=(streamoff __off)
  5530.       {
  5531.  _M_off += __off;
  5532.  return *this;
  5533.       }
  5534.       fpos&
  5535.       operator-=(streamoff __off)
  5536.       {
  5537.  _M_off -= __off;
  5538.  return *this;
  5539.       }
  5540.       fpos
  5541.       operator+(streamoff __off) const
  5542.       {
  5543.  fpos __pos(*this);
  5544.  __pos += __off;
  5545.  return __pos;
  5546.       }
  5547.       fpos
  5548.       operator-(streamoff __off) const
  5549.       {
  5550.  fpos __pos(*this);
  5551.  __pos -= __off;
  5552.  return __pos;
  5553.       }
  5554.       streamoff
  5555.       operator-(const fpos& __other) const
  5556.       { return _M_off - __other._M_off; }
  5557.     };
  5558.   template<typename _StateT>
  5559.     inline bool
  5560.     operator==(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
  5561.     { return streamoff(__lhs) == streamoff(__rhs); }
  5562.   template<typename _StateT>
  5563.     inline bool
  5564.     operator!=(const fpos<_StateT>& __lhs, const fpos<_StateT>& __rhs)
  5565.     { return streamoff(__lhs) != streamoff(__rhs); }
  5566.   typedef fpos<mbstate_t> streampos;
  5567.   typedef fpos<mbstate_t> wstreampos;
  5568.   typedef fpos<mbstate_t> u16streampos;
  5569.   typedef fpos<mbstate_t> u32streampos;
  5570.  
  5571. }
  5572. namespace std __attribute__ ((__visibility__ ("default")))
  5573. {
  5574.  
  5575.   class ios_base;
  5576.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5577.     class basic_ios;
  5578.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5579.     class basic_streambuf;
  5580.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5581.     class basic_istream;
  5582.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5583.     class basic_ostream;
  5584.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5585.     class basic_iostream;
  5586.   template<typename _CharT, typename _Traits = char_traits<_CharT>,
  5587.      typename _Alloc = allocator<_CharT> >
  5588.     class basic_stringbuf;
  5589.   template<typename _CharT, typename _Traits = char_traits<_CharT>,
  5590.     typename _Alloc = allocator<_CharT> >
  5591.     class basic_istringstream;
  5592.   template<typename _CharT, typename _Traits = char_traits<_CharT>,
  5593.     typename _Alloc = allocator<_CharT> >
  5594.     class basic_ostringstream;
  5595.   template<typename _CharT, typename _Traits = char_traits<_CharT>,
  5596.     typename _Alloc = allocator<_CharT> >
  5597.     class basic_stringstream;
  5598.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5599.     class basic_filebuf;
  5600.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5601.     class basic_ifstream;
  5602.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5603.     class basic_ofstream;
  5604.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5605.     class basic_fstream;
  5606.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5607.     class istreambuf_iterator;
  5608.   template<typename _CharT, typename _Traits = char_traits<_CharT> >
  5609.     class ostreambuf_iterator;
  5610.   typedef basic_ios<char> ios;
  5611.   typedef basic_streambuf<char> streambuf;
  5612.   typedef basic_istream<char> istream;
  5613.   typedef basic_ostream<char> ostream;
  5614.   typedef basic_iostream<char> iostream;
  5615.   typedef basic_stringbuf<char> stringbuf;
  5616.   typedef basic_istringstream<char> istringstream;
  5617.   typedef basic_ostringstream<char> ostringstream;
  5618.   typedef basic_stringstream<char> stringstream;
  5619.   typedef basic_filebuf<char> filebuf;
  5620.   typedef basic_ifstream<char> ifstream;
  5621.   typedef basic_ofstream<char> ofstream;
  5622.   typedef basic_fstream<char> fstream;
  5623.   typedef basic_ios<wchar_t> wios;
  5624.   typedef basic_streambuf<wchar_t> wstreambuf;
  5625.   typedef basic_istream<wchar_t> wistream;
  5626.   typedef basic_ostream<wchar_t> wostream;
  5627.   typedef basic_iostream<wchar_t> wiostream;
  5628.   typedef basic_stringbuf<wchar_t> wstringbuf;
  5629.   typedef basic_istringstream<wchar_t> wistringstream;
  5630.   typedef basic_ostringstream<wchar_t> wostringstream;
  5631.   typedef basic_stringstream<wchar_t> wstringstream;
  5632.   typedef basic_filebuf<wchar_t> wfilebuf;
  5633.   typedef basic_ifstream<wchar_t> wifstream;
  5634.   typedef basic_ofstream<wchar_t> wofstream;
  5635.   typedef basic_fstream<wchar_t> wfstream;
  5636.  
  5637. }
  5638. #pragma GCC visibility push(default)
  5639. typedef unsigned char __u_char;
  5640. typedef unsigned short int __u_short;
  5641. typedef unsigned int __u_int;
  5642. typedef unsigned long int __u_long;
  5643. typedef signed char __int8_t;
  5644. typedef unsigned char __uint8_t;
  5645. typedef signed short int __int16_t;
  5646. typedef unsigned short int __uint16_t;
  5647. typedef signed int __int32_t;
  5648. typedef unsigned int __uint32_t;
  5649. typedef signed long int __int64_t;
  5650. typedef unsigned long int __uint64_t;
  5651. typedef long int __quad_t;
  5652. typedef unsigned long int __u_quad_t;
  5653. typedef unsigned long int __dev_t;
  5654. typedef unsigned int __uid_t;
  5655. typedef unsigned int __gid_t;
  5656. typedef unsigned long int __ino_t;
  5657. typedef unsigned long int __ino64_t;
  5658. typedef unsigned int __mode_t;
  5659. typedef unsigned long int __nlink_t;
  5660. typedef long int __off_t;
  5661. typedef long int __off64_t;
  5662. typedef int __pid_t;
  5663. typedef struct { int __val[2]; } __fsid_t;
  5664. typedef long int __clock_t;
  5665. typedef unsigned long int __rlim_t;
  5666. typedef unsigned long int __rlim64_t;
  5667. typedef unsigned int __id_t;
  5668. typedef long int __time_t;
  5669. typedef unsigned int __useconds_t;
  5670. typedef long int __suseconds_t;
  5671. typedef int __daddr_t;
  5672. typedef long int __swblk_t;
  5673. typedef int __key_t;
  5674. typedef int __clockid_t;
  5675. typedef void * __timer_t;
  5676. typedef long int __blksize_t;
  5677. typedef long int __blkcnt_t;
  5678. typedef long int __blkcnt64_t;
  5679. typedef unsigned long int __fsblkcnt_t;
  5680. typedef unsigned long int __fsblkcnt64_t;
  5681. typedef unsigned long int __fsfilcnt_t;
  5682. typedef unsigned long int __fsfilcnt64_t;
  5683. typedef long int __ssize_t;
  5684. typedef __off64_t __loff_t;
  5685. typedef __quad_t *__qaddr_t;
  5686. typedef char *__caddr_t;
  5687. typedef long int __intptr_t;
  5688. typedef unsigned int __socklen_t;
  5689.  
  5690. typedef __time_t time_t;
  5691.  
  5692.  
  5693. struct timespec
  5694.   {
  5695.     __time_t tv_sec;
  5696.     long int tv_nsec;
  5697.   };
  5698. typedef __pid_t pid_t;
  5699. struct sched_param
  5700.   {
  5701.     int __sched_priority;
  5702.   };
  5703. extern "C" {
  5704. extern int clone (int (*__fn) (void *__arg), void *__child_stack,
  5705.     int __flags, void *__arg, ...) throw ();
  5706. extern int unshare (int __flags) throw ();
  5707. extern int sched_getcpu (void) throw ();
  5708. }
  5709. struct __sched_param
  5710.   {
  5711.     int __sched_priority;
  5712.   };
  5713. typedef unsigned long int __cpu_mask;
  5714. typedef struct
  5715. {
  5716.   __cpu_mask __bits[1024 / (8 * sizeof (__cpu_mask))];
  5717. } cpu_set_t;
  5718. extern "C" {
  5719. extern int __sched_cpucount (size_t __setsize, const cpu_set_t *__setp)
  5720.   throw ();
  5721. extern cpu_set_t *__sched_cpualloc (size_t __count) throw () ;
  5722. extern void __sched_cpufree (cpu_set_t *__set) throw ();
  5723. }
  5724. extern "C" {
  5725. extern int sched_setparam (__pid_t __pid, __const struct sched_param *__param)
  5726.      throw ();
  5727. extern int sched_getparam (__pid_t __pid, struct sched_param *__param) throw ();
  5728. extern int sched_setscheduler (__pid_t __pid, int __policy,
  5729.           __const struct sched_param *__param) throw ();
  5730. extern int sched_getscheduler (__pid_t __pid) throw ();
  5731. extern int sched_yield (void) throw ();
  5732. extern int sched_get_priority_max (int __algorithm) throw ();
  5733. extern int sched_get_priority_min (int __algorithm) throw ();
  5734. extern int sched_rr_get_interval (__pid_t __pid, struct timespec *__t) throw ();
  5735. extern int sched_setaffinity (__pid_t __pid, size_t __cpusetsize,
  5736.          __const cpu_set_t *__cpuset) throw ();
  5737. extern int sched_getaffinity (__pid_t __pid, size_t __cpusetsize,
  5738.          cpu_set_t *__cpuset) throw ();
  5739. }
  5740. extern "C" {
  5741.  
  5742. typedef __clock_t clock_t;
  5743.  
  5744.  
  5745. typedef __clockid_t clockid_t;
  5746. typedef __timer_t timer_t;
  5747.  
  5748. struct tm
  5749. {
  5750.   int tm_sec;
  5751.   int tm_min;
  5752.   int tm_hour;
  5753.   int tm_mday;
  5754.   int tm_mon;
  5755.   int tm_year;
  5756.   int tm_wday;
  5757.   int tm_yday;
  5758.   int tm_isdst;
  5759.   long int tm_gmtoff;
  5760.   __const char *tm_zone;
  5761. };
  5762.  
  5763.  
  5764. struct itimerspec
  5765.   {
  5766.     struct timespec it_interval;
  5767.     struct timespec it_value;
  5768.   };
  5769. struct sigevent;
  5770.  
  5771. extern clock_t clock (void) throw ();
  5772. extern time_t time (time_t *__timer) throw ();
  5773. extern double difftime (time_t __time1, time_t __time0)
  5774.      throw () __attribute__ ((__const__));
  5775. extern time_t mktime (struct tm *__tp) throw ();
  5776. extern size_t strftime (char *__restrict __s, size_t __maxsize,
  5777.    __const char *__restrict __format,
  5778.    __const struct tm *__restrict __tp) throw ();
  5779.  
  5780. extern char *strptime (__const char *__restrict __s,
  5781.          __const char *__restrict __fmt, struct tm *__tp)
  5782.      throw ();
  5783. extern size_t strftime_l (char *__restrict __s, size_t __maxsize,
  5784.      __const char *__restrict __format,
  5785.      __const struct tm *__restrict __tp,
  5786.      __locale_t __loc) throw ();
  5787. extern char *strptime_l (__const char *__restrict __s,
  5788.     __const char *__restrict __fmt, struct tm *__tp,
  5789.     __locale_t __loc) throw ();
  5790.  
  5791. extern struct tm *gmtime (__const time_t *__timer) throw ();
  5792. extern struct tm *localtime (__const time_t *__timer) throw ();
  5793.  
  5794. extern struct tm *gmtime_r (__const time_t *__restrict __timer,
  5795.        struct tm *__restrict __tp) throw ();
  5796. extern struct tm *localtime_r (__const time_t *__restrict __timer,
  5797.           struct tm *__restrict __tp) throw ();
  5798.  
  5799. extern char *asctime (__const struct tm *__tp) throw ();
  5800. extern char *ctime (__const time_t *__timer) throw ();
  5801.  
  5802. extern char *asctime_r (__const struct tm *__restrict __tp,
  5803.    char *__restrict __buf) throw ();
  5804. extern char *ctime_r (__const time_t *__restrict __timer,
  5805.         char *__restrict __buf) throw ();
  5806. extern char *__tzname[2];
  5807. extern int __daylight;
  5808. extern long int __timezone;
  5809. extern char *tzname[2];
  5810. extern void tzset (void) throw ();
  5811. extern int daylight;
  5812. extern long int timezone;
  5813. extern int stime (__const time_t *__when) throw ();
  5814. extern time_t timegm (struct tm *__tp) throw ();
  5815. extern time_t timelocal (struct tm *__tp) throw ();
  5816. extern int dysize (int __year) throw () __attribute__ ((__const__));
  5817. extern int nanosleep (__const struct timespec *__requested_time,
  5818.         struct timespec *__remaining);
  5819. extern int clock_getres (clockid_t __clock_id, struct timespec *__res) throw ();
  5820. extern int clock_gettime (clockid_t __clock_id, struct timespec *__tp) throw ();
  5821. extern int clock_settime (clockid_t __clock_id, __const struct timespec *__tp)
  5822.      throw ();
  5823. extern int clock_nanosleep (clockid_t __clock_id, int __flags,
  5824.        __const struct timespec *__req,
  5825.        struct timespec *__rem);
  5826. extern int clock_getcpuclockid (pid_t __pid, clockid_t *__clock_id) throw ();
  5827. extern int timer_create (clockid_t __clock_id,
  5828.     struct sigevent *__restrict __evp,
  5829.     timer_t *__restrict __timerid) throw ();
  5830. extern int timer_delete (timer_t __timerid) throw ();
  5831. extern int timer_settime (timer_t __timerid, int __flags,
  5832.      __const struct itimerspec *__restrict __value,
  5833.      struct itimerspec *__restrict __ovalue) throw ();
  5834. extern int timer_gettime (timer_t __timerid, struct itimerspec *__value)
  5835.      throw ();
  5836. extern int timer_getoverrun (timer_t __timerid) throw ();
  5837. extern int getdate_err;
  5838. extern struct tm *getdate (__const char *__string);
  5839. extern int getdate_r (__const char *__restrict __string,
  5840.         struct tm *__restrict __resbufp);
  5841. }
  5842. typedef unsigned long int pthread_t;
  5843. typedef union
  5844. {
  5845.   char __size[56];
  5846.   long int __align;
  5847. } pthread_attr_t;
  5848. typedef struct __pthread_internal_list
  5849. {
  5850.   struct __pthread_internal_list *__prev;
  5851.   struct __pthread_internal_list *__next;
  5852. } __pthread_list_t;
  5853. typedef union
  5854. {
  5855.   struct __pthread_mutex_s
  5856.   {
  5857.     int __lock;
  5858.     unsigned int __count;
  5859.     int __owner;
  5860.     unsigned int __nusers;
  5861.     int __kind;
  5862.     int __spins;
  5863.     __pthread_list_t __list;
  5864.   } __data;
  5865.   char __size[40];
  5866.   long int __align;
  5867. } pthread_mutex_t;
  5868. typedef union
  5869. {
  5870.   char __size[4];
  5871.   int __align;
  5872. } pthread_mutexattr_t;
  5873. typedef union
  5874. {
  5875.   struct
  5876.   {
  5877.     int __lock;
  5878.     unsigned int __futex;
  5879.     __extension__ unsigned long long int __total_seq;
  5880.     __extension__ unsigned long long int __wakeup_seq;
  5881.     __extension__ unsigned long long int __woken_seq;
  5882.     void *__mutex;
  5883.     unsigned int __nwaiters;
  5884.     unsigned int __broadcast_seq;
  5885.   } __data;
  5886.   char __size[48];
  5887.   __extension__ long long int __align;
  5888. } pthread_cond_t;
  5889. typedef union
  5890. {
  5891.   char __size[4];
  5892.   int __align;
  5893. } pthread_condattr_t;
  5894. typedef unsigned int pthread_key_t;
  5895. typedef int pthread_once_t;
  5896. typedef union
  5897. {
  5898.   struct
  5899.   {
  5900.     int __lock;
  5901.     unsigned int __nr_readers;
  5902.     unsigned int __readers_wakeup;
  5903.     unsigned int __writer_wakeup;
  5904.     unsigned int __nr_readers_queued;
  5905.     unsigned int __nr_writers_queued;
  5906.     int __writer;
  5907.     int __shared;
  5908.     unsigned long int __pad1;
  5909.     unsigned long int __pad2;
  5910.     unsigned int __flags;
  5911.   } __data;
  5912.   char __size[56];
  5913.   long int __align;
  5914. } pthread_rwlock_t;
  5915. typedef union
  5916. {
  5917.   char __size[8];
  5918.   long int __align;
  5919. } pthread_rwlockattr_t;
  5920. typedef volatile int pthread_spinlock_t;
  5921. typedef union
  5922. {
  5923.   char __size[32];
  5924.   long int __align;
  5925. } pthread_barrier_t;
  5926. typedef union
  5927. {
  5928.   char __size[4];
  5929.   int __align;
  5930. } pthread_barrierattr_t;
  5931. typedef long int __jmp_buf[8];
  5932. enum
  5933. {
  5934.   PTHREAD_CREATE_JOINABLE,
  5935.   PTHREAD_CREATE_DETACHED
  5936. };
  5937. enum
  5938. {
  5939.   PTHREAD_MUTEX_TIMED_NP,
  5940.   PTHREAD_MUTEX_RECURSIVE_NP,
  5941.   PTHREAD_MUTEX_ERRORCHECK_NP,
  5942.   PTHREAD_MUTEX_ADAPTIVE_NP
  5943.   ,
  5944.   PTHREAD_MUTEX_NORMAL = PTHREAD_MUTEX_TIMED_NP,
  5945.   PTHREAD_MUTEX_RECURSIVE = PTHREAD_MUTEX_RECURSIVE_NP,
  5946.   PTHREAD_MUTEX_ERRORCHECK = PTHREAD_MUTEX_ERRORCHECK_NP,
  5947.   PTHREAD_MUTEX_DEFAULT = PTHREAD_MUTEX_NORMAL
  5948.   , PTHREAD_MUTEX_FAST_NP = PTHREAD_MUTEX_TIMED_NP
  5949. };
  5950. enum
  5951. {
  5952.   PTHREAD_MUTEX_STALLED,
  5953.   PTHREAD_MUTEX_STALLED_NP = PTHREAD_MUTEX_STALLED,
  5954.   PTHREAD_MUTEX_ROBUST,
  5955.   PTHREAD_MUTEX_ROBUST_NP = PTHREAD_MUTEX_ROBUST
  5956. };
  5957. enum
  5958. {
  5959.   PTHREAD_PRIO_NONE,
  5960.   PTHREAD_PRIO_INHERIT,
  5961.   PTHREAD_PRIO_PROTECT
  5962. };
  5963. enum
  5964. {
  5965.   PTHREAD_RWLOCK_PREFER_READER_NP,
  5966.   PTHREAD_RWLOCK_PREFER_WRITER_NP,
  5967.   PTHREAD_RWLOCK_PREFER_WRITER_NONRECURSIVE_NP,
  5968.   PTHREAD_RWLOCK_DEFAULT_NP = PTHREAD_RWLOCK_PREFER_READER_NP
  5969. };
  5970. enum
  5971. {
  5972.   PTHREAD_INHERIT_SCHED,
  5973.   PTHREAD_EXPLICIT_SCHED
  5974. };
  5975. enum
  5976. {
  5977.   PTHREAD_SCOPE_SYSTEM,
  5978.   PTHREAD_SCOPE_PROCESS
  5979. };
  5980. enum
  5981. {
  5982.   PTHREAD_PROCESS_PRIVATE,
  5983.   PTHREAD_PROCESS_SHARED
  5984. };
  5985. struct _pthread_cleanup_buffer
  5986. {
  5987.   void (*__routine) (void *);
  5988.   void *__arg;
  5989.   int __canceltype;
  5990.   struct _pthread_cleanup_buffer *__prev;
  5991. };
  5992. enum
  5993. {
  5994.   PTHREAD_CANCEL_ENABLE,
  5995.   PTHREAD_CANCEL_DISABLE
  5996. };
  5997. enum
  5998. {
  5999.   PTHREAD_CANCEL_DEFERRED,
  6000.   PTHREAD_CANCEL_ASYNCHRONOUS
  6001. };
  6002. extern "C" {
  6003. extern int pthread_create (pthread_t *__restrict __newthread,
  6004.       __const pthread_attr_t *__restrict __attr,
  6005.       void *(*__start_routine) (void *),
  6006.       void *__restrict __arg) throw () __attribute__ ((__nonnull__ (1, 3)));
  6007. extern void pthread_exit (void *__retval) __attribute__ ((__noreturn__));
  6008. extern int pthread_join (pthread_t __th, void **__thread_return);
  6009. extern int pthread_tryjoin_np (pthread_t __th, void **__thread_return) throw ();
  6010. extern int pthread_timedjoin_np (pthread_t __th, void **__thread_return,
  6011.      __const struct timespec *__abstime);
  6012. extern int pthread_detach (pthread_t __th) throw ();
  6013. extern pthread_t pthread_self (void) throw () __attribute__ ((__const__));
  6014. extern int pthread_equal (pthread_t __thread1, pthread_t __thread2) throw ();
  6015. extern int pthread_attr_init (pthread_attr_t *__attr) throw () __attribute__ ((__nonnull__ (1)));
  6016. extern int pthread_attr_destroy (pthread_attr_t *__attr)
  6017.      throw () __attribute__ ((__nonnull__ (1)));
  6018. extern int pthread_attr_getdetachstate (__const pthread_attr_t *__attr,
  6019.      int *__detachstate)
  6020.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6021. extern int pthread_attr_setdetachstate (pthread_attr_t *__attr,
  6022.      int __detachstate)
  6023.      throw () __attribute__ ((__nonnull__ (1)));
  6024. extern int pthread_attr_getguardsize (__const pthread_attr_t *__attr,
  6025.           size_t *__guardsize)
  6026.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6027. extern int pthread_attr_setguardsize (pthread_attr_t *__attr,
  6028.           size_t __guardsize)
  6029.      throw () __attribute__ ((__nonnull__ (1)));
  6030. extern int pthread_attr_getschedparam (__const pthread_attr_t *__restrict
  6031.            __attr,
  6032.            struct sched_param *__restrict __param)
  6033.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6034. extern int pthread_attr_setschedparam (pthread_attr_t *__restrict __attr,
  6035.            __const struct sched_param *__restrict
  6036.            __param) throw () __attribute__ ((__nonnull__ (1, 2)));
  6037. extern int pthread_attr_getschedpolicy (__const pthread_attr_t *__restrict
  6038.      __attr, int *__restrict __policy)
  6039.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6040. extern int pthread_attr_setschedpolicy (pthread_attr_t *__attr, int __policy)
  6041.      throw () __attribute__ ((__nonnull__ (1)));
  6042. extern int pthread_attr_getinheritsched (__const pthread_attr_t *__restrict
  6043.       __attr, int *__restrict __inherit)
  6044.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6045. extern int pthread_attr_setinheritsched (pthread_attr_t *__attr,
  6046.       int __inherit)
  6047.      throw () __attribute__ ((__nonnull__ (1)));
  6048. extern int pthread_attr_getscope (__const pthread_attr_t *__restrict __attr,
  6049.       int *__restrict __scope)
  6050.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6051. extern int pthread_attr_setscope (pthread_attr_t *__attr, int __scope)
  6052.      throw () __attribute__ ((__nonnull__ (1)));
  6053. extern int pthread_attr_getstackaddr (__const pthread_attr_t *__restrict
  6054.           __attr, void **__restrict __stackaddr)
  6055.      throw () __attribute__ ((__nonnull__ (1, 2))) __attribute__ ((__deprecated__));
  6056. extern int pthread_attr_setstackaddr (pthread_attr_t *__attr,
  6057.           void *__stackaddr)
  6058.      throw () __attribute__ ((__nonnull__ (1))) __attribute__ ((__deprecated__));
  6059. extern int pthread_attr_getstacksize (__const pthread_attr_t *__restrict
  6060.           __attr, size_t *__restrict __stacksize)
  6061.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6062. extern int pthread_attr_setstacksize (pthread_attr_t *__attr,
  6063.           size_t __stacksize)
  6064.      throw () __attribute__ ((__nonnull__ (1)));
  6065. extern int pthread_attr_getstack (__const pthread_attr_t *__restrict __attr,
  6066.       void **__restrict __stackaddr,
  6067.       size_t *__restrict __stacksize)
  6068.      throw () __attribute__ ((__nonnull__ (1, 2, 3)));
  6069. extern int pthread_attr_setstack (pthread_attr_t *__attr, void *__stackaddr,
  6070.       size_t __stacksize) throw () __attribute__ ((__nonnull__ (1)));
  6071. extern int pthread_attr_setaffinity_np (pthread_attr_t *__attr,
  6072.      size_t __cpusetsize,
  6073.      __const cpu_set_t *__cpuset)
  6074.      throw () __attribute__ ((__nonnull__ (1, 3)));
  6075. extern int pthread_attr_getaffinity_np (__const pthread_attr_t *__attr,
  6076.      size_t __cpusetsize,
  6077.      cpu_set_t *__cpuset)
  6078.      throw () __attribute__ ((__nonnull__ (1, 3)));
  6079. extern int pthread_getattr_np (pthread_t __th, pthread_attr_t *__attr)
  6080.      throw () __attribute__ ((__nonnull__ (2)));
  6081. extern int pthread_setschedparam (pthread_t __target_thread, int __policy,
  6082.       __const struct sched_param *__param)
  6083.      throw () __attribute__ ((__nonnull__ (3)));
  6084. extern int pthread_getschedparam (pthread_t __target_thread,
  6085.       int *__restrict __policy,
  6086.       struct sched_param *__restrict __param)
  6087.      throw () __attribute__ ((__nonnull__ (2, 3)));
  6088. extern int pthread_setschedprio (pthread_t __target_thread, int __prio)
  6089.      throw ();
  6090. extern int pthread_getname_np (pthread_t __target_thread, char *__buf,
  6091.           size_t __buflen)
  6092.      throw () __attribute__ ((__nonnull__ (2)));
  6093. extern int pthread_setname_np (pthread_t __target_thread, __const char *__name)
  6094.      throw () __attribute__ ((__nonnull__ (2)));
  6095. extern int pthread_getconcurrency (void) throw ();
  6096. extern int pthread_setconcurrency (int __level) throw ();
  6097. extern int pthread_yield (void) throw ();
  6098. extern int pthread_setaffinity_np (pthread_t __th, size_t __cpusetsize,
  6099.        __const cpu_set_t *__cpuset)
  6100.      throw () __attribute__ ((__nonnull__ (3)));
  6101. extern int pthread_getaffinity_np (pthread_t __th, size_t __cpusetsize,
  6102.        cpu_set_t *__cpuset)
  6103.      throw () __attribute__ ((__nonnull__ (3)));
  6104. extern int pthread_once (pthread_once_t *__once_control,
  6105.     void (*__init_routine) (void)) __attribute__ ((__nonnull__ (1, 2)));
  6106. extern int pthread_setcancelstate (int __state, int *__oldstate);
  6107. extern int pthread_setcanceltype (int __type, int *__oldtype);
  6108. extern int pthread_cancel (pthread_t __th);
  6109. extern void pthread_testcancel (void);
  6110. typedef struct
  6111. {
  6112.   struct
  6113.   {
  6114.     __jmp_buf __cancel_jmp_buf;
  6115.     int __mask_was_saved;
  6116.   } __cancel_jmp_buf[1];
  6117.   void *__pad[4];
  6118. } __pthread_unwind_buf_t __attribute__ ((__aligned__));
  6119. struct __pthread_cleanup_frame
  6120. {
  6121.   void (*__cancel_routine) (void *);
  6122.   void *__cancel_arg;
  6123.   int __do_it;
  6124.   int __cancel_type;
  6125. };
  6126. class __pthread_cleanup_class
  6127. {
  6128.   void (*__cancel_routine) (void *);
  6129.   void *__cancel_arg;
  6130.   int __do_it;
  6131.   int __cancel_type;
  6132.  public:
  6133.   __pthread_cleanup_class (void (*__fct) (void *), void *__arg)
  6134.     : __cancel_routine (__fct), __cancel_arg (__arg), __do_it (1) { }
  6135.   ~__pthread_cleanup_class () { if (__do_it) __cancel_routine (__cancel_arg); }
  6136.   void __setdoit (int __newval) { __do_it = __newval; }
  6137.   void __defer () { pthread_setcanceltype (PTHREAD_CANCEL_DEFERRED,
  6138.         &__cancel_type); }
  6139.   void __restore () const { pthread_setcanceltype (__cancel_type, 0); }
  6140. };
  6141. struct __jmp_buf_tag;
  6142. extern int __sigsetjmp (struct __jmp_buf_tag *__env, int __savemask) throw ();
  6143. extern int pthread_mutex_init (pthread_mutex_t *__mutex,
  6144.           __const pthread_mutexattr_t *__mutexattr)
  6145.      throw () __attribute__ ((__nonnull__ (1)));
  6146. extern int pthread_mutex_destroy (pthread_mutex_t *__mutex)
  6147.      throw () __attribute__ ((__nonnull__ (1)));
  6148. extern int pthread_mutex_trylock (pthread_mutex_t *__mutex)
  6149.      throw () __attribute__ ((__nonnull__ (1)));
  6150. extern int pthread_mutex_lock (pthread_mutex_t *__mutex)
  6151.      throw () __attribute__ ((__nonnull__ (1)));
  6152. extern int pthread_mutex_timedlock (pthread_mutex_t *__restrict __mutex,
  6153.         __const struct timespec *__restrict
  6154.         __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
  6155. extern int pthread_mutex_unlock (pthread_mutex_t *__mutex)
  6156.      throw () __attribute__ ((__nonnull__ (1)));
  6157. extern int pthread_mutex_getprioceiling (__const pthread_mutex_t *
  6158.       __restrict __mutex,
  6159.       int *__restrict __prioceiling)
  6160.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6161. extern int pthread_mutex_setprioceiling (pthread_mutex_t *__restrict __mutex,
  6162.       int __prioceiling,
  6163.       int *__restrict __old_ceiling)
  6164.      throw () __attribute__ ((__nonnull__ (1, 3)));
  6165. extern int pthread_mutex_consistent (pthread_mutex_t *__mutex)
  6166.      throw () __attribute__ ((__nonnull__ (1)));
  6167. extern int pthread_mutex_consistent_np (pthread_mutex_t *__mutex)
  6168.      throw () __attribute__ ((__nonnull__ (1)));
  6169. extern int pthread_mutexattr_init (pthread_mutexattr_t *__attr)
  6170.      throw () __attribute__ ((__nonnull__ (1)));
  6171. extern int pthread_mutexattr_destroy (pthread_mutexattr_t *__attr)
  6172.      throw () __attribute__ ((__nonnull__ (1)));
  6173. extern int pthread_mutexattr_getpshared (__const pthread_mutexattr_t *
  6174.       __restrict __attr,
  6175.       int *__restrict __pshared)
  6176.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6177. extern int pthread_mutexattr_setpshared (pthread_mutexattr_t *__attr,
  6178.       int __pshared)
  6179.      throw () __attribute__ ((__nonnull__ (1)));
  6180. extern int pthread_mutexattr_gettype (__const pthread_mutexattr_t *__restrict
  6181.           __attr, int *__restrict __kind)
  6182.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6183. extern int pthread_mutexattr_settype (pthread_mutexattr_t *__attr, int __kind)
  6184.      throw () __attribute__ ((__nonnull__ (1)));
  6185. extern int pthread_mutexattr_getprotocol (__const pthread_mutexattr_t *
  6186.        __restrict __attr,
  6187.        int *__restrict __protocol)
  6188.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6189. extern int pthread_mutexattr_setprotocol (pthread_mutexattr_t *__attr,
  6190.        int __protocol)
  6191.      throw () __attribute__ ((__nonnull__ (1)));
  6192. extern int pthread_mutexattr_getprioceiling (__const pthread_mutexattr_t *
  6193.           __restrict __attr,
  6194.           int *__restrict __prioceiling)
  6195.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6196. extern int pthread_mutexattr_setprioceiling (pthread_mutexattr_t *__attr,
  6197.           int __prioceiling)
  6198.      throw () __attribute__ ((__nonnull__ (1)));
  6199. extern int pthread_mutexattr_getrobust (__const pthread_mutexattr_t *__attr,
  6200.      int *__robustness)
  6201.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6202. extern int pthread_mutexattr_getrobust_np (__const pthread_mutexattr_t *__attr,
  6203.         int *__robustness)
  6204.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6205. extern int pthread_mutexattr_setrobust (pthread_mutexattr_t *__attr,
  6206.      int __robustness)
  6207.      throw () __attribute__ ((__nonnull__ (1)));
  6208. extern int pthread_mutexattr_setrobust_np (pthread_mutexattr_t *__attr,
  6209.         int __robustness)
  6210.      throw () __attribute__ ((__nonnull__ (1)));
  6211. extern int pthread_rwlock_init (pthread_rwlock_t *__restrict __rwlock,
  6212.     __const pthread_rwlockattr_t *__restrict
  6213.     __attr) throw () __attribute__ ((__nonnull__ (1)));
  6214. extern int pthread_rwlock_destroy (pthread_rwlock_t *__rwlock)
  6215.      throw () __attribute__ ((__nonnull__ (1)));
  6216. extern int pthread_rwlock_rdlock (pthread_rwlock_t *__rwlock)
  6217.      throw () __attribute__ ((__nonnull__ (1)));
  6218. extern int pthread_rwlock_tryrdlock (pthread_rwlock_t *__rwlock)
  6219.   throw () __attribute__ ((__nonnull__ (1)));
  6220. extern int pthread_rwlock_timedrdlock (pthread_rwlock_t *__restrict __rwlock,
  6221.            __const struct timespec *__restrict
  6222.            __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
  6223. extern int pthread_rwlock_wrlock (pthread_rwlock_t *__rwlock)
  6224.      throw () __attribute__ ((__nonnull__ (1)));
  6225. extern int pthread_rwlock_trywrlock (pthread_rwlock_t *__rwlock)
  6226.      throw () __attribute__ ((__nonnull__ (1)));
  6227. extern int pthread_rwlock_timedwrlock (pthread_rwlock_t *__restrict __rwlock,
  6228.            __const struct timespec *__restrict
  6229.            __abstime) throw () __attribute__ ((__nonnull__ (1, 2)));
  6230. extern int pthread_rwlock_unlock (pthread_rwlock_t *__rwlock)
  6231.      throw () __attribute__ ((__nonnull__ (1)));
  6232. extern int pthread_rwlockattr_init (pthread_rwlockattr_t *__attr)
  6233.      throw () __attribute__ ((__nonnull__ (1)));
  6234. extern int pthread_rwlockattr_destroy (pthread_rwlockattr_t *__attr)
  6235.      throw () __attribute__ ((__nonnull__ (1)));
  6236. extern int pthread_rwlockattr_getpshared (__const pthread_rwlockattr_t *
  6237.        __restrict __attr,
  6238.        int *__restrict __pshared)
  6239.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6240. extern int pthread_rwlockattr_setpshared (pthread_rwlockattr_t *__attr,
  6241.        int __pshared)
  6242.      throw () __attribute__ ((__nonnull__ (1)));
  6243. extern int pthread_rwlockattr_getkind_np (__const pthread_rwlockattr_t *
  6244.        __restrict __attr,
  6245.        int *__restrict __pref)
  6246.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6247. extern int pthread_rwlockattr_setkind_np (pthread_rwlockattr_t *__attr,
  6248.        int __pref) throw () __attribute__ ((__nonnull__ (1)));
  6249. extern int pthread_cond_init (pthread_cond_t *__restrict __cond,
  6250.          __const pthread_condattr_t *__restrict
  6251.          __cond_attr) throw () __attribute__ ((__nonnull__ (1)));
  6252. extern int pthread_cond_destroy (pthread_cond_t *__cond)
  6253.      throw () __attribute__ ((__nonnull__ (1)));
  6254. extern int pthread_cond_signal (pthread_cond_t *__cond)
  6255.      throw () __attribute__ ((__nonnull__ (1)));
  6256. extern int pthread_cond_broadcast (pthread_cond_t *__cond)
  6257.      throw () __attribute__ ((__nonnull__ (1)));
  6258. extern int pthread_cond_wait (pthread_cond_t *__restrict __cond,
  6259.          pthread_mutex_t *__restrict __mutex)
  6260.      __attribute__ ((__nonnull__ (1, 2)));
  6261. extern int pthread_cond_timedwait (pthread_cond_t *__restrict __cond,
  6262.        pthread_mutex_t *__restrict __mutex,
  6263.        __const struct timespec *__restrict
  6264.        __abstime) __attribute__ ((__nonnull__ (1, 2, 3)));
  6265. extern int pthread_condattr_init (pthread_condattr_t *__attr)
  6266.      throw () __attribute__ ((__nonnull__ (1)));
  6267. extern int pthread_condattr_destroy (pthread_condattr_t *__attr)
  6268.      throw () __attribute__ ((__nonnull__ (1)));
  6269. extern int pthread_condattr_getpshared (__const pthread_condattr_t *
  6270.      __restrict __attr,
  6271.      int *__restrict __pshared)
  6272.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6273. extern int pthread_condattr_setpshared (pthread_condattr_t *__attr,
  6274.      int __pshared) throw () __attribute__ ((__nonnull__ (1)));
  6275. extern int pthread_condattr_getclock (__const pthread_condattr_t *
  6276.           __restrict __attr,
  6277.           __clockid_t *__restrict __clock_id)
  6278.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6279. extern int pthread_condattr_setclock (pthread_condattr_t *__attr,
  6280.           __clockid_t __clock_id)
  6281.      throw () __attribute__ ((__nonnull__ (1)));
  6282. extern int pthread_spin_init (pthread_spinlock_t *__lock, int __pshared)
  6283.      throw () __attribute__ ((__nonnull__ (1)));
  6284. extern int pthread_spin_destroy (pthread_spinlock_t *__lock)
  6285.      throw () __attribute__ ((__nonnull__ (1)));
  6286. extern int pthread_spin_lock (pthread_spinlock_t *__lock)
  6287.      throw () __attribute__ ((__nonnull__ (1)));
  6288. extern int pthread_spin_trylock (pthread_spinlock_t *__lock)
  6289.      throw () __attribute__ ((__nonnull__ (1)));
  6290. extern int pthread_spin_unlock (pthread_spinlock_t *__lock)
  6291.      throw () __attribute__ ((__nonnull__ (1)));
  6292. extern int pthread_barrier_init (pthread_barrier_t *__restrict __barrier,
  6293.      __const pthread_barrierattr_t *__restrict
  6294.      __attr, unsigned int __count)
  6295.      throw () __attribute__ ((__nonnull__ (1)));
  6296. extern int pthread_barrier_destroy (pthread_barrier_t *__barrier)
  6297.      throw () __attribute__ ((__nonnull__ (1)));
  6298. extern int pthread_barrier_wait (pthread_barrier_t *__barrier)
  6299.      throw () __attribute__ ((__nonnull__ (1)));
  6300. extern int pthread_barrierattr_init (pthread_barrierattr_t *__attr)
  6301.      throw () __attribute__ ((__nonnull__ (1)));
  6302. extern int pthread_barrierattr_destroy (pthread_barrierattr_t *__attr)
  6303.      throw () __attribute__ ((__nonnull__ (1)));
  6304. extern int pthread_barrierattr_getpshared (__const pthread_barrierattr_t *
  6305.         __restrict __attr,
  6306.         int *__restrict __pshared)
  6307.      throw () __attribute__ ((__nonnull__ (1, 2)));
  6308. extern int pthread_barrierattr_setpshared (pthread_barrierattr_t *__attr,
  6309.         int __pshared)
  6310.      throw () __attribute__ ((__nonnull__ (1)));
  6311. extern int pthread_key_create (pthread_key_t *__key,
  6312.           void (*__destr_function) (void *))
  6313.      throw () __attribute__ ((__nonnull__ (1)));
  6314. extern int pthread_key_delete (pthread_key_t __key) throw ();
  6315. extern void *pthread_getspecific (pthread_key_t __key) throw ();
  6316. extern int pthread_setspecific (pthread_key_t __key,
  6317.     __const void *__pointer) throw () ;
  6318. extern int pthread_getcpuclockid (pthread_t __thread_id,
  6319.       __clockid_t *__clock_id)
  6320.      throw () __attribute__ ((__nonnull__ (2)));
  6321. extern int pthread_atfork (void (*__prepare) (void),
  6322.       void (*__parent) (void),
  6323.       void (*__child) (void)) throw ();
  6324. }
  6325. typedef pthread_t __gthread_t;
  6326. typedef pthread_key_t __gthread_key_t;
  6327. typedef pthread_once_t __gthread_once_t;
  6328. typedef pthread_mutex_t __gthread_mutex_t;
  6329. typedef pthread_mutex_t __gthread_recursive_mutex_t;
  6330. typedef pthread_cond_t __gthread_cond_t;
  6331. typedef struct timespec __gthread_time_t;
  6332. static __typeof(pthread_once) __gthrw_pthread_once __attribute__ ((__weakref__("pthread_once")));
  6333. static __typeof(pthread_getspecific) __gthrw_pthread_getspecific __attribute__ ((__weakref__("pthread_getspecific")));
  6334. static __typeof(pthread_setspecific) __gthrw_pthread_setspecific __attribute__ ((__weakref__("pthread_setspecific")));
  6335. static __typeof(pthread_create) __gthrw_pthread_create __attribute__ ((__weakref__("pthread_create")));
  6336. static __typeof(pthread_join) __gthrw_pthread_join __attribute__ ((__weakref__("pthread_join")));
  6337. static __typeof(pthread_equal) __gthrw_pthread_equal __attribute__ ((__weakref__("pthread_equal")));
  6338. static __typeof(pthread_self) __gthrw_pthread_self __attribute__ ((__weakref__("pthread_self")));
  6339. static __typeof(pthread_detach) __gthrw_pthread_detach __attribute__ ((__weakref__("pthread_detach")));
  6340. static __typeof(pthread_cancel) __gthrw_pthread_cancel __attribute__ ((__weakref__("pthread_cancel")));
  6341. static __typeof(sched_yield) __gthrw_sched_yield __attribute__ ((__weakref__("sched_yield")));
  6342. static __typeof(pthread_mutex_lock) __gthrw_pthread_mutex_lock __attribute__ ((__weakref__("pthread_mutex_lock")));
  6343. static __typeof(pthread_mutex_trylock) __gthrw_pthread_mutex_trylock __attribute__ ((__weakref__("pthread_mutex_trylock")));
  6344. static __typeof(pthread_mutex_timedlock) __gthrw_pthread_mutex_timedlock __attribute__ ((__weakref__("pthread_mutex_timedlock")));
  6345. static __typeof(pthread_mutex_unlock) __gthrw_pthread_mutex_unlock __attribute__ ((__weakref__("pthread_mutex_unlock")));
  6346. static __typeof(pthread_mutex_init) __gthrw_pthread_mutex_init __attribute__ ((__weakref__("pthread_mutex_init")));
  6347. static __typeof(pthread_mutex_destroy) __gthrw_pthread_mutex_destroy __attribute__ ((__weakref__("pthread_mutex_destroy")));
  6348. static __typeof(pthread_cond_init) __gthrw_pthread_cond_init __attribute__ ((__weakref__("pthread_cond_init")));
  6349. static __typeof(pthread_cond_broadcast) __gthrw_pthread_cond_broadcast __attribute__ ((__weakref__("pthread_cond_broadcast")));
  6350. static __typeof(pthread_cond_signal) __gthrw_pthread_cond_signal __attribute__ ((__weakref__("pthread_cond_signal")));
  6351. static __typeof(pthread_cond_wait) __gthrw_pthread_cond_wait __attribute__ ((__weakref__("pthread_cond_wait")));
  6352. static __typeof(pthread_cond_timedwait) __gthrw_pthread_cond_timedwait __attribute__ ((__weakref__("pthread_cond_timedwait")));
  6353. static __typeof(pthread_cond_destroy) __gthrw_pthread_cond_destroy __attribute__ ((__weakref__("pthread_cond_destroy")));
  6354. static __typeof(pthread_key_create) __gthrw_pthread_key_create __attribute__ ((__weakref__("pthread_key_create")));
  6355. static __typeof(pthread_key_delete) __gthrw_pthread_key_delete __attribute__ ((__weakref__("pthread_key_delete")));
  6356. static __typeof(pthread_mutexattr_init) __gthrw_pthread_mutexattr_init __attribute__ ((__weakref__("pthread_mutexattr_init")));
  6357. static __typeof(pthread_mutexattr_settype) __gthrw_pthread_mutexattr_settype __attribute__ ((__weakref__("pthread_mutexattr_settype")));
  6358. static __typeof(pthread_mutexattr_destroy) __gthrw_pthread_mutexattr_destroy __attribute__ ((__weakref__("pthread_mutexattr_destroy")));
  6359. static inline int
  6360. __gthread_active_p (void)
  6361. {
  6362.   static void *const __gthread_active_ptr
  6363.     = __extension__ (void *) &__gthrw_pthread_cancel;
  6364.   return __gthread_active_ptr != 0;
  6365. }
  6366. static inline int
  6367. __gthread_create (__gthread_t *__threadid, void *(*__func) (void*),
  6368.     void *__args)
  6369. {
  6370.   return __gthrw_pthread_create (__threadid, __null, __func, __args);
  6371. }
  6372. static inline int
  6373. __gthread_join (__gthread_t __threadid, void **__value_ptr)
  6374. {
  6375.   return __gthrw_pthread_join (__threadid, __value_ptr);
  6376. }
  6377. static inline int
  6378. __gthread_detach (__gthread_t __threadid)
  6379. {
  6380.   return __gthrw_pthread_detach (__threadid);
  6381. }
  6382. static inline int
  6383. __gthread_equal (__gthread_t __t1, __gthread_t __t2)
  6384. {
  6385.   return __gthrw_pthread_equal (__t1, __t2);
  6386. }
  6387. static inline __gthread_t
  6388. __gthread_self (void)
  6389. {
  6390.   return __gthrw_pthread_self ();
  6391. }
  6392. static inline int
  6393. __gthread_yield (void)
  6394. {
  6395.   return __gthrw_sched_yield ();
  6396. }
  6397. static inline int
  6398. __gthread_once (__gthread_once_t *__once, void (*__func) (void))
  6399. {
  6400.   if (__gthread_active_p ())
  6401.     return __gthrw_pthread_once (__once, __func);
  6402.   else
  6403.     return -1;
  6404. }
  6405. static inline int
  6406. __gthread_key_create (__gthread_key_t *__key, void (*__dtor) (void *))
  6407. {
  6408.   return __gthrw_pthread_key_create (__key, __dtor);
  6409. }
  6410. static inline int
  6411. __gthread_key_delete (__gthread_key_t __key)
  6412. {
  6413.   return __gthrw_pthread_key_delete (__key);
  6414. }
  6415. static inline void *
  6416. __gthread_getspecific (__gthread_key_t __key)
  6417. {
  6418.   return __gthrw_pthread_getspecific (__key);
  6419. }
  6420. static inline int
  6421. __gthread_setspecific (__gthread_key_t __key, const void *__ptr)
  6422. {
  6423.   return __gthrw_pthread_setspecific (__key, __ptr);
  6424. }
  6425. static inline int
  6426. __gthread_mutex_destroy (__gthread_mutex_t *__mutex)
  6427. {
  6428.   if (__gthread_active_p ())
  6429.     return __gthrw_pthread_mutex_destroy (__mutex);
  6430.   else
  6431.     return 0;
  6432. }
  6433. static inline int
  6434. __gthread_mutex_lock (__gthread_mutex_t *__mutex)
  6435. {
  6436.   if (__gthread_active_p ())
  6437.     return __gthrw_pthread_mutex_lock (__mutex);
  6438.   else
  6439.     return 0;
  6440. }
  6441. static inline int
  6442. __gthread_mutex_trylock (__gthread_mutex_t *__mutex)
  6443. {
  6444.   if (__gthread_active_p ())
  6445.     return __gthrw_pthread_mutex_trylock (__mutex);
  6446.   else
  6447.     return 0;
  6448. }
  6449. static inline int
  6450. __gthread_mutex_timedlock (__gthread_mutex_t *__mutex,
  6451.       const __gthread_time_t *__abs_timeout)
  6452. {
  6453.   if (__gthread_active_p ())
  6454.     return __gthrw_pthread_mutex_timedlock (__mutex, __abs_timeout);
  6455.   else
  6456.     return 0;
  6457. }
  6458. static inline int
  6459. __gthread_mutex_unlock (__gthread_mutex_t *__mutex)
  6460. {
  6461.   if (__gthread_active_p ())
  6462.     return __gthrw_pthread_mutex_unlock (__mutex);
  6463.   else
  6464.     return 0;
  6465. }
  6466. static inline int
  6467. __gthread_recursive_mutex_lock (__gthread_recursive_mutex_t *__mutex)
  6468. {
  6469.   return __gthread_mutex_lock (__mutex);
  6470. }
  6471. static inline int
  6472. __gthread_recursive_mutex_trylock (__gthread_recursive_mutex_t *__mutex)
  6473. {
  6474.   return __gthread_mutex_trylock (__mutex);
  6475. }
  6476. static inline int
  6477. __gthread_recursive_mutex_timedlock (__gthread_recursive_mutex_t *__mutex,
  6478.          const __gthread_time_t *__abs_timeout)
  6479. {
  6480.   return __gthread_mutex_timedlock (__mutex, __abs_timeout);
  6481. }
  6482. static inline int
  6483. __gthread_recursive_mutex_unlock (__gthread_recursive_mutex_t *__mutex)
  6484. {
  6485.   return __gthread_mutex_unlock (__mutex);
  6486. }
  6487. static inline int
  6488. __gthread_cond_broadcast (__gthread_cond_t *__cond)
  6489. {
  6490.   return __gthrw_pthread_cond_broadcast (__cond);
  6491. }
  6492. static inline int
  6493. __gthread_cond_signal (__gthread_cond_t *__cond)
  6494. {
  6495.   return __gthrw_pthread_cond_signal (__cond);
  6496. }
  6497. static inline int
  6498. __gthread_cond_wait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex)
  6499. {
  6500.   return __gthrw_pthread_cond_wait (__cond, __mutex);
  6501. }
  6502. static inline int
  6503. __gthread_cond_timedwait (__gthread_cond_t *__cond, __gthread_mutex_t *__mutex,
  6504.      const __gthread_time_t *__abs_timeout)
  6505. {
  6506.   return __gthrw_pthread_cond_timedwait (__cond, __mutex, __abs_timeout);
  6507. }
  6508. static inline int
  6509. __gthread_cond_wait_recursive (__gthread_cond_t *__cond,
  6510.           __gthread_recursive_mutex_t *__mutex)
  6511. {
  6512.   return __gthread_cond_wait (__cond, __mutex);
  6513. }
  6514. static inline int
  6515. __gthread_cond_timedwait_recursive (__gthread_cond_t *__cond,
  6516.         __gthread_recursive_mutex_t *__mutex,
  6517.         const __gthread_time_t *__abs_timeout)
  6518. {
  6519.   return __gthread_cond_timedwait (__cond, __mutex, __abs_timeout);
  6520. }
  6521. static inline int
  6522. __gthread_cond_destroy (__gthread_cond_t* __cond)
  6523. {
  6524.   return __gthrw_pthread_cond_destroy (__cond);
  6525. }
  6526. #pragma GCC visibility pop
  6527. typedef int _Atomic_word;
  6528. namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
  6529. {
  6530.  
  6531.   static inline _Atomic_word
  6532.   __exchange_and_add(volatile _Atomic_word* __mem, int __val)
  6533.   { return __atomic_fetch_add(__mem, __val, 4); }
  6534.   static inline void
  6535.   __atomic_add(volatile _Atomic_word* __mem, int __val)
  6536.   { __atomic_fetch_add(__mem, __val, 4); }
  6537.   static inline _Atomic_word
  6538.   __exchange_and_add_single(_Atomic_word* __mem, int __val)
  6539.   {
  6540.     _Atomic_word __result = *__mem;
  6541.     *__mem += __val;
  6542.     return __result;
  6543.   }
  6544.   static inline void
  6545.   __atomic_add_single(_Atomic_word* __mem, int __val)
  6546.   { *__mem += __val; }
  6547.   static inline _Atomic_word
  6548.   __attribute__ ((__unused__))
  6549.   __exchange_and_add_dispatch(_Atomic_word* __mem, int __val)
  6550.   {
  6551.     if (__gthread_active_p())
  6552.       return __exchange_and_add(__mem, __val);
  6553.     else
  6554.       return __exchange_and_add_single(__mem, __val);
  6555.   }
  6556.   static inline void
  6557.   __attribute__ ((__unused__))
  6558.   __atomic_add_dispatch(_Atomic_word* __mem, int __val)
  6559.   {
  6560.     if (__gthread_active_p())
  6561.       __atomic_add(__mem, __val);
  6562.     else
  6563.       __atomic_add_single(__mem, __val);
  6564.   }
  6565.  
  6566. }
  6567.        
  6568. namespace __gnu_cxx __attribute__ ((__visibility__ ("default")))
  6569. {
  6570.  
  6571.   enum _Lock_policy { _S_single, _S_mutex, _S_atomic };
  6572.   static const _Lock_policy __default_lock_policy =
  6573.   _S_atomic;
  6574.   class __concurrence_lock_error : public std::exception
  6575.   {
  6576.   public:
  6577.     virtual char const*
  6578.     what() const throw()
  6579.     { return "__gnu_cxx::__concurrence_lock_error"; }
  6580.   };
  6581.   class __concurrence_unlock_error : public std::exception
  6582.   {
  6583.   public:
  6584.     virtual char const*
  6585.     what() const throw()
  6586.     { return "__gnu_cxx::__concurrence_unlock_error"; }
  6587.   };
  6588.   class __concurrence_broadcast_error : public std::exception
  6589.   {
  6590.   public:
  6591.     virtual char const*
  6592.     what() const throw()
  6593.     { return "__gnu_cxx::__concurrence_broadcast_error"; }
  6594.   };
  6595.   class __concurrence_wait_error : public std::exception
  6596.   {
  6597.   public:
  6598.     virtual char const*
  6599.     what() const throw()
  6600.     { return "__gnu_cxx::__concurrence_wait_error"; }
  6601.   };
  6602.   inline void
  6603.   __throw_concurrence_lock_error()
  6604.   {
  6605.     throw __concurrence_lock_error();
  6606.   }
  6607.   inline void
  6608.   __throw_concurrence_unlock_error()
  6609.   {
  6610.     throw __concurrence_unlock_error();
  6611.   }
  6612.   inline void
  6613.   __throw_concurrence_broadcast_error()
  6614.   {
  6615.     throw __concurrence_broadcast_error();
  6616.   }
  6617.   inline void
  6618.   __throw_concurrence_wait_error()
  6619.   {
  6620.     throw __concurrence_wait_error();
  6621.   }
  6622.   class __mutex
  6623.   {
  6624.   private:
  6625.     __gthread_mutex_t _M_mutex = { { 0, 0, 0, 0, 0, 0, { 0, 0 } } };
  6626.     __mutex(const __mutex&);
  6627.     __mutex& operator=(const __mutex&);
  6628.   public:
  6629.     __mutex()
  6630.     {
  6631.     }
  6632.     void lock()
  6633.     {
  6634.       if (__gthread_active_p())
  6635.  {
  6636.    if (__gthread_mutex_lock(&_M_mutex) != 0)
  6637.      __throw_concurrence_lock_error();
  6638.  }
  6639.     }
  6640.     void unlock()
  6641.     {
  6642.       if (__gthread_active_p())
  6643.  {
  6644.    if (__gthread_mutex_unlock(&_M_mutex) != 0)
  6645.      __throw_concurrence_unlock_error();
  6646.  }
  6647.     }
  6648.     __gthread_mutex_t* gthread_mutex(void)
  6649.       { return &_M_mutex; }
  6650.   };
  6651.   class __recursive_mutex
  6652.   {
  6653.   private:
  6654.     __gthread_recursive_mutex_t _M_mutex = { { 0, 0, 0, 0, PTHREAD_MUTEX_RECURSIVE_NP, 0, { 0, 0 } } };
  6655.     __recursive_mutex(const __recursive_mutex&);
  6656.     __recursive_mutex& operator=(const __recursive_mutex&);
  6657.   public:
  6658.     __recursive_mutex()
  6659.     {
  6660.     }
  6661.     void lock()
  6662.     {
  6663.       if (__gthread_active_p())
  6664.  {
  6665.    if (__gthread_recursive_mutex_lock(&_M_mutex) != 0)
  6666.      __throw_concurrence_lock_error();
  6667.  }
  6668.     }
  6669.     void unlock()
  6670.     {
  6671.       if (__gthread_active_p())
  6672.  {
  6673.    if (__gthread_recursive_mutex_unlock(&_M_mutex) != 0)
  6674.      __throw_concurrence_unlock_error();
  6675.  }
  6676.     }
  6677.     __gthread_recursive_mutex_t* gthread_recursive_mutex(void)
  6678.     { return &_M_mutex; }
  6679.   };
  6680.   class __scoped_lock
  6681.   {
  6682.   public:
  6683.     typedef __mutex __mutex_type;
  6684.   private:
  6685.     __mutex_type& _M_device;
  6686.     __scoped_lock(const __scoped_lock&);
  6687.     __scoped_lock& operator=(const __scoped_lock&);
  6688.   public:
  6689.     explicit __scoped_lock(__mutex_type& __name) : _M_device(__name)
  6690.     { _M_device.lock(); }
  6691.     ~__scoped_lock() throw()
  6692.     { _M_device.unlock(); }
  6693.   };
  6694.   class __cond
  6695.   {
  6696.   private:
  6697.     __gthread_cond_t _M_cond = { { 0, 0, 0, 0, 0, (void *) 0, 0, 0 } };
  6698.     __cond(const __cond&);
  6699.     __cond& operator=(const __cond&);
  6700.   public:
  6701.     __cond()
  6702.     {
  6703.     }
  6704.     void broadcast()
  6705.     {
  6706.       if (__gthread_active_p())
  6707.  {
  6708.    if (__gthread_cond_broadcast(&_M_cond) != 0)
  6709.      __throw_concurrence_broadcast_error();
  6710.  }
  6711.     }
  6712.     void wait(__mutex *mutex)
  6713.     {
  6714.       {
  6715.    if (__gthread_cond_wait(&_M_cond, mutex->gthread_mutex()) != 0)
  6716.      __throw_concurrence_wait_error();
  6717.       }
  6718.     }
  6719.     void wait_recursive(__recursive_mutex *mutex)
  6720.     {
  6721.       {
  6722.    if (__gthread_cond_wait_recursive(&_M_cond,
  6723.          mutex->gthread_recursive_mutex())
  6724.        != 0)
  6725.      __throw_concurrence_wait_error();
  6726.       }
  6727.     }
  6728.   };
  6729.  
  6730. }
  6731. namespace std __attribute__ ((__visibility__ ("default")))
  6732. {
  6733.  
  6734.   template<typename _Arg, typename _Result>
  6735.     struct unary_function
  6736.     {
  6737.       typedef _Arg argument_type;
  6738.       typedef _Result result_type;
  6739.     };
  6740.   template<typename _Arg1, typename _Arg2, typename _Result>
  6741.     struct binary_function
  6742.     {
  6743.       typedef _Arg1 first_argument_type;
  6744.       typedef _Arg2 second_argument_type;
  6745.       typedef _Result result_type;
  6746.     };
  6747.   template<typename _Tp>
  6748.     struct plus : public binary_function<_Tp, _Tp, _Tp>
  6749.     {
  6750.       _Tp
  6751.       operator()(const _Tp& __x, const _Tp& __y) const
  6752.       { return __x + __y; }
  6753.     };
  6754.   template<typename _Tp>
  6755.     struct minus : public binary_function<_Tp, _Tp, _Tp>
  6756.     {
  6757.       _Tp
  6758.       operator()(const _Tp& __x, const _Tp& __y) const
  6759.       { return __x - __y; }
  6760.     };
  6761.   template<typename _Tp>
  6762.     struct multiplies : public binary_function<_Tp, _Tp, _Tp>
  6763.     {
  6764.       _Tp
  6765.       operator()(const _Tp& __x, const _Tp& __y) const
  6766.       { return __x * __y; }
  6767.     };
  6768.   template<typename _Tp>
  6769.     struct divides : public binary_function<_Tp, _Tp, _Tp>
  6770.     {
  6771.       _Tp
  6772.       operator()(const _Tp& __x, const _Tp& __y) const
  6773.       { return __x / __y; }
  6774.     };
  6775.   template<typename _Tp>
  6776.     struct modulus : public binary_function<_Tp, _Tp, _Tp>
  6777.     {
  6778.       _Tp
  6779.       operator()(const _Tp& __x, const _Tp& __y) const
  6780.       { return __x % __y; }
  6781.     };
  6782.   template<typename _Tp>
  6783.     struct negate : public unary_function<_Tp, _Tp>
  6784.     {
  6785.       _Tp
  6786.       operator()(const _Tp& __x) const
  6787.       { return -__x; }
  6788.     };
  6789.   template<typename _Tp>
  6790.     struct equal_to : public binary_function<_Tp, _Tp, bool>
  6791.     {
  6792.       bool
  6793.       operator()(const _Tp& __x, const _Tp& __y) const
  6794.       { return __x == __y; }
  6795.     };
  6796.   template<typename _Tp>
  6797.     struct not_equal_to : public binary_function<_Tp, _Tp, bool>
  6798.     {
  6799.       bool
  6800.       operator()(const _Tp& __x, const _Tp& __y) const
  6801.       { return __x != __y; }
  6802.     };
  6803.   template<typename _Tp>
  6804.     struct greater : public binary_function<_Tp, _Tp, bool>
  6805.     {
  6806.       bool
  6807.       operator()(const _Tp& __x, const _Tp& __y) const
  6808.       { return __x > __y; }
  6809.     };
  6810.   template<typename _Tp>
  6811.     struct less : public binary_function<_Tp, _Tp, bool>
  6812.     {
  6813.       bool
  6814.       operator()(const _Tp& __x, const _Tp& __y) const
  6815.       { return __x < __y; }
  6816.     };
  6817.   template<typename _Tp>
  6818.     struct greater_equal : public binary_function<_Tp, _Tp, bool>
  6819.     {
  6820.       bool
  6821.       operator()(const _Tp& __x, const _Tp& __y) const
  6822.       { return __x >= __y; }
  6823.     };
  6824.   template<typename _Tp>
  6825.     struct less_equal : public binary_function<_Tp, _Tp, bool>
  6826.     {
  6827.       bool
  6828.       operator()(const _Tp& __x, const _Tp& __y) const
  6829.       { return __x <= __y; }
  6830.     };
  6831.   template<typename _Tp>
  6832.     struct logical_and : public binary_function<_Tp, _Tp, bool>
  6833.     {
  6834.       bool
  6835.       operator()(const _Tp& __x, const _Tp& __y) const
  6836.       { return __x && __y; }
  6837.     };
  6838.   template<typename _Tp>
  6839.     struct logical_or : public binary_function<_Tp, _Tp, bool>
  6840.     {
  6841.       bool
  6842.       operator()(const _Tp& __x, const _Tp& __y) const
  6843.       { return __x || __y; }
  6844.     };
  6845.   template<typename _Tp>
  6846.     struct logical_not : public unary_function<_Tp, bool>
  6847.     {
  6848.       bool
  6849.       operator()(const _Tp& __x) const
  6850.       { return !__x; }
  6851.     };
  6852.   template<typename _Tp>
  6853.     struct bit_and : public binary_function<_Tp, _Tp, _Tp>
  6854.     {
  6855.       _Tp
  6856.       operator()(const _Tp& __x, const _Tp& __y) const
  6857.       { return __x & __y; }
  6858.     };
  6859.   template<typename _Tp>
  6860.     struct bit_or : public binary_function<_Tp, _Tp, _Tp>
  6861.     {
  6862.       _Tp
  6863.       operator()(const _Tp& __x, const _Tp& __y) const
  6864.       { return __x | __y; }
  6865.     };
  6866.   template<typename _Tp>
  6867.     struct bit_xor : public binary_function<_Tp, _Tp, _Tp>
  6868.     {
  6869.       _Tp
  6870.       operator()(const _Tp& __x, const _Tp& __y) const
  6871.       { return __x ^ __y; }
  6872.     };
  6873.   template<typename _Predicate>
  6874.     class unary_negate
  6875.     : public unary_function<typename _Predicate::argument_type, bool>
  6876.     {
  6877.     protected:
  6878.       _Predicate _M_pred;
  6879.     public:
  6880.       explicit
  6881.       unary_negate(const _Predicate& __x) : _M_pred(__x) { }
  6882.       bool
  6883.       operator()(const typename _Predicate::argument_type& __x) const
  6884.       { return !_M_pred(__x); }
  6885.     };
  6886.   template<typename _Predicate>
  6887.     inline unary_negate<_Predicate>
  6888.     not1(const _Predicate& __pred)
  6889.     { return unary_negate<_Predicate>(__pred); }
  6890.   template<typename _Predicate>
  6891.     class binary_negate
  6892.     : public binary_function<typename _Predicate::first_argument_type,
  6893.         typename _Predicate::second_argument_type, bool>
  6894.     {
  6895.     protected:
  6896.       _Predicate _M_pred;
  6897.     public:
  6898.       explicit
  6899.       binary_negate(const _Predicate& __x) : _M_pred(__x) { }
  6900.       bool
  6901.       operator()(const typename _Predicate::first_argument_type& __x,
  6902.    const typename _Predicate::second_argument_type& __y) const
  6903.       { return !_M_pred(__x, __y); }
  6904.     };
  6905.   template<typename _Predicate>
  6906.     inline binary_negate<_Predicate>
  6907.     not2(const _Predicate& __pred)
  6908.     { return binary_negate<_Predicate>(__pred); }
  6909.   template<typename _Arg, typename _Result>
  6910.     class pointer_to_unary_function : public unary_function<_Arg, _Result>
  6911.     {
  6912.     protected:
  6913.       _Result (*_M_ptr)(_Arg);
  6914.     public:
  6915.       pointer_to_unary_function() { }
  6916.       explicit
  6917.       pointer_to_unary_function(_Result (*__x)(_Arg))
  6918.       : _M_ptr(__x) { }
  6919.       _Result
  6920.       operator()(_Arg __x) const
  6921.       { return _M_ptr(__x); }
  6922.     };
  6923.   template<typename _Arg, typename _Result>
  6924.     inline pointer_to_unary_function<_Arg, _Result>
  6925.     ptr_fun(_Result (*__x)(_Arg))
  6926.     { return pointer_to_unary_function<_Arg, _Result>(__x); }
  6927.   template<typename _Arg1, typename _Arg2, typename _Result>
  6928.     class pointer_to_binary_function
  6929.     : public binary_function<_Arg1, _Arg2, _Result>
  6930.     {
  6931.     protected:
  6932.       _Result (*_M_ptr)(_Arg1, _Arg2);
  6933.     public:
  6934.       pointer_to_binary_function() { }
  6935.       explicit
  6936.       pointer_to_binary_function(_Result (*__x)(_Arg1, _Arg2))
  6937.       : _M_ptr(__x) { }
  6938.       _Result
  6939.       operator()(_Arg1 __x, _Arg2 __y) const
  6940.       { return _M_ptr(__x, __y); }
  6941.     };
  6942.   template<typename _Arg1, typename _Arg2, typename _Result>
  6943.     inline pointer_to_binary_function<_Arg1, _Arg2, _Result>
  6944.     ptr_fun(_Result (*__x)(_Arg1, _Arg2))
  6945.     { return pointer_to_binary_function<_Arg1, _Arg2, _Result>(__x); }
  6946.   template<typename _Tp>
  6947.     struct _Identity
  6948.     {
  6949.       _Tp&
  6950.       operator()(_Tp& __x) const
  6951.       { return __x; }
  6952.       const _Tp&
  6953.       operator()(const _Tp& __x) const
  6954.       { return __x; }
  6955.     };
  6956.   template<typename _Pair>
  6957.     struct _Select1st
  6958.     {
  6959.       typename _Pair::first_type&
  6960.       operator()(_Pair& __x) const
  6961.       { return __x.first; }
  6962.       const typename _Pair::first_type&
  6963.       operator()(const _Pair& __x) const
  6964.       { return __x.first; }
  6965.       template<typename _Pair2>
  6966.         typename _Pair2::first_type&
  6967.         operator()(_Pair2& __x) const
  6968.         { return __x.first; }
  6969.       template<typename _Pair2>
  6970.         const typename _Pair2::first_type&
  6971.         operator()(const _Pair2& __x) const
  6972.         { return __x.first; }
  6973.     };
  6974.   template<typename _Pair>
  6975.     struct _Select2nd
  6976.     {
  6977.       typename _Pair::second_type&
  6978.       operator()(_Pair& __x) const
  6979.       { return __x.second; }
  6980.       const typename _Pair::second_type&
  6981.       operator()(const _Pair& __x) const
  6982.       { return __x.second; }
  6983.     };
  6984.   template<typename _Ret, typename _Tp>
  6985.     class mem_fun_t : public unary_function<_Tp*, _Ret>
  6986.     {
  6987.     public:
  6988.       explicit
  6989.       mem_fun_t(_Ret (_Tp::*__pf)())
  6990.       : _M_f(__pf) { }
  6991.       _Ret
  6992.       operator()(_Tp* __p) const
  6993.       { return (__p->*_M_f)(); }
  6994.     private:
  6995.       _Ret (_Tp::*_M_f)();
  6996.     };
  6997.   template<typename _Ret, typename _Tp>
  6998.     class const_mem_fun_t : public unary_function<const _Tp*, _Ret>
  6999.     {
  7000.     public:
  7001.       explicit
  7002.       const_mem_fun_t(_Ret (_Tp::*__pf)() const)
  7003.       : _M_f(__pf) { }
  7004.       _Ret
  7005.       operator()(const _Tp* __p) const
  7006.       { return (__p->*_M_f)(); }
  7007.     private:
  7008.       _Ret (_Tp::*_M_f)() const;
  7009.     };
  7010.   template<typename _Ret, typename _Tp>
  7011.     class mem_fun_ref_t : public unary_function<_Tp, _Ret>
  7012.     {
  7013.     public:
  7014.       explicit
  7015.       mem_fun_ref_t(_Ret (_Tp::*__pf)())
  7016.       : _M_f(__pf) { }
  7017.       _Ret
  7018.       operator()(_Tp& __r) const
  7019.       { return (__r.*_M_f)(); }
  7020.     private:
  7021.       _Ret (_Tp::*_M_f)();
  7022.   };
  7023.   template<typename _Ret, typename _Tp>
  7024.     class const_mem_fun_ref_t : public unary_function<_Tp, _Ret>
  7025.     {
  7026.     public:
  7027.       explicit
  7028.       const_mem_fun_ref_t(_Ret (_Tp::*__pf)() const)
  7029.       : _M_f(__pf) { }
  7030.       _Ret
  7031.       operator()(const _Tp& __r) const
  7032.       { return (__r.*_M_f)(); }
  7033.     private:
  7034.       _Ret (_Tp::*_M_f)() const;
  7035.     };
  7036.   template<typename _Ret, typename _Tp, typename _Arg>
  7037.     class mem_fun1_t : public binary_function<_Tp*, _Arg, _Ret>
  7038.     {
  7039.     public:
  7040.       explicit
  7041.       mem_fun1_t(_Ret (_Tp::*__pf)(_Arg))
  7042.       : _M_f(__pf) { }
  7043.       _Ret
  7044.       operator()(_Tp* __p, _Arg __x) const
  7045.       { return (__p->*_M_f)(__x); }
  7046.     private:
  7047.       _Ret (_Tp::*_M_f)(_Arg);
  7048.     };
  7049.   template<typename _Ret, typename _Tp, typename _Arg>
  7050.     class const_mem_fun1_t : public binary_function<const _Tp*, _Arg, _Ret>
  7051.     {
  7052.     public:
  7053.       explicit
  7054.       const_mem_fun1_t(_Ret (_Tp::*__pf)(_Arg) const)
  7055.       : _M_f(__pf) { }
  7056.       _Ret
  7057.       operator()(const _Tp* __p, _Arg __x) const
  7058.       { return (__p->*_M_f)(__x); }
  7059.     private:
  7060.       _Ret (_Tp::*_M_f)(_Arg) const;
  7061.     };
  7062.   template<typename _Ret, typename _Tp, typename _Arg>
  7063.     class mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
  7064.     {
  7065.     public:
  7066.       explicit
  7067.       mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg))
  7068.       : _M_f(__pf) { }
  7069.       _Ret
  7070.       operator()(_Tp& __r, _Arg __x) const
  7071.       { return (__r.*_M_f)(__x); }
  7072.     private:
  7073.       _Ret (_Tp::*_M_f)(_Arg);
  7074.     };
  7075.   template<typename _Ret, typename _Tp, typename _Arg>
  7076.     class const_mem_fun1_ref_t : public binary_function<_Tp, _Arg, _Ret>
  7077.     {
  7078.     public:
  7079.       explicit
  7080.       const_mem_fun1_ref_t(_Ret (_Tp::*__pf)(_Arg) const)
  7081.       : _M_f(__pf) { }
  7082.       _Ret
  7083.       operator()(const _Tp& __r, _Arg __x) const
  7084.       { return (__r.*_M_f)(__x); }
  7085.     private:
  7086.       _Ret (_Tp::*_M_f)(_Arg) const;
  7087.     };
  7088.   template<typename _Ret, typename _Tp>
  7089.     inline mem_fun_t<_Ret, _Tp>
  7090.     mem_fun(_Ret (_Tp::*__f)())
  7091.     { return mem_fun_t<_Ret, _Tp>(__f); }
  7092.   template<typename _Ret, typename _Tp>
  7093.     inline const_mem_fun_t<_Ret, _Tp>
  7094.     mem_fun(_Ret (_Tp::*__f)() const)
  7095.     { return const_mem_fun_t<_Ret, _Tp>(__f); }
  7096.   template<typename _Ret, typename _Tp>
  7097.     inline mem_fun_ref_t<_Ret, _Tp>
  7098.     mem_fun_ref(_Ret (_Tp::*__f)())
  7099.     { return mem_fun_ref_t<_Ret, _Tp>(__f); }
  7100.   template<typename _Ret, typename _Tp>
  7101.     inline const_mem_fun_ref_t<_Ret, _Tp>
  7102.     mem_fun_ref(_Ret (_Tp::*__f)() const)
  7103.     { return const_mem_fun_ref_t<_Ret, _Tp>(__f); }
  7104.   template<typename _Ret, typename _Tp, typename _Arg>
  7105.     inline mem_fun1_t<_Ret, _Tp, _Arg>
  7106.     mem_fun(_Ret (_Tp::*__f)(_Arg))
  7107.     { return mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
  7108.   template<typename _Ret, typename _Tp, typename _Arg>
  7109.     inline const_mem_fun1_t<_Ret, _Tp, _Arg>
  7110.     mem_fun(_Ret (_Tp::*__f)(_Arg) const)
  7111.     { return const_mem_fun1_t<_Ret, _Tp, _Arg>(__f); }
  7112.   template<typename _Ret, typename _Tp, typename _Arg>
  7113.     inline mem_fun1_ref_t<_Ret, _Tp, _Arg>
  7114.     mem_fun_ref(_Ret (_Tp::*__f)(_Arg))
  7115.     { return mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
  7116.   template<typename _Ret, typename _Tp, typename _Arg>
  7117.     inline const_mem_fun1_ref_t<_Ret, _Tp, _Arg>
  7118.     mem_fun_ref(_Ret (_Tp::*__f)(_Arg) const)
  7119.     { return const_mem_fun1_ref_t<_Ret, _Tp, _Arg>(__f); }
  7120.  
  7121. }
  7122. namespace std __attribute__ ((__visibility__ ("default")))
  7123. {
  7124.  
  7125.   template<typename _Operation>
  7126.     class binder1st
  7127.     : public unary_function<typename _Operation::second_argument_type,
  7128.        typename _Operation::result_type>
  7129.     {
  7130.     protected:
  7131.       _Operation op;
  7132.       typename _Operation::first_argument_type value;
  7133.     public:
  7134.       binder1st(const _Operation& __x,
  7135.   const typename _Operation::first_argument_type& __y)
  7136.       : op(__x), value(__y) { }
  7137.       typename _Operation::result_type
  7138.       operator()(const typename _Operation::second_argument_type& __x) const
  7139.       { return op(value, __x); }
  7140.       typename _Operation::result_type
  7141.       operator()(typename _Operation::second_argument_type& __x) const
  7142.       { return op(value, __x); }
  7143.     } __attribute__ ((__deprecated__));
  7144.   template<typename _Operation, typename _Tp>
  7145.     inline binder1st<_Operation>
  7146.     bind1st(const _Operation& __fn, const _Tp& __x)
  7147.     {
  7148.       typedef typename _Operation::first_argument_type _Arg1_type;
  7149.       return binder1st<_Operation>(__fn, _Arg1_type(__x));
  7150.     }
  7151.   template<typename _Operation>
  7152.     class binder2nd
  7153.     : public unary_function<typename _Operation::first_argument_type,
  7154.        typename _Operation::result_type>
  7155.     {
  7156.     protected:
  7157.       _Operation op;
  7158.       typename _Operation::second_argument_type value;
  7159.     public:
  7160.       binder2nd(const _Operation& __x,
  7161.   const typename _Operation::second_argument_type& __y)
  7162.       : op(__x), value(__y) { }
  7163.       typename _Operation::result_type
  7164.       operator()(const typename _Operation::first_argument_type& __x) const
  7165.       { return op(__x, value); }
  7166.       typename _Operation::result_type
  7167.       operator()(typename _Operation::first_argument_type& __x) const
  7168.       { return op(__x, value); }
  7169.     } __attribute__ ((__deprecated__));
  7170.   template<typename _Operation, typename _Tp>
  7171.     inline binder2nd<_Operation>
  7172.     bind2nd(const _Operation& __fn, const _Tp& __x)
  7173.     {
  7174.       typedef typename _Operation::second_argument_type _Arg2_type;
  7175.       return binder2nd<_Operation>(__fn, _Arg2_type(__x));
  7176.     }
  7177.  
  7178. }
  7179. namespace std __attribute__ ((__visibility__ ("default")))
  7180. {
  7181.  
  7182.   struct allocator_arg_t { };
  7183.   constexpr allocator_arg_t allocator_arg = allocator_arg_t();
  7184. template<typename _Tp> class __has_allocator_type_helper : __sfinae_types { template<typename _Up> struct _Wrap_type { }; template<typename _Up> static __one __test(_Wrap_type<typename _Up::allocator_type>*); template<typename _Up> static __two __test(...); public: static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; }; template<typename _Tp> struct __has_allocator_type : integral_constant<bool, __has_allocator_type_helper <typename remove_cv<_Tp>::type>::value> { };
  7185.   template<typename _Tp, typename _Alloc,
  7186.     bool = __has_allocator_type<_Tp>::value>
  7187.     struct __uses_allocator_helper
  7188.     : public false_type { };
  7189.   template<typename _Tp, typename _Alloc>
  7190.     struct __uses_allocator_helper<_Tp, _Alloc, true>
  7191.     : public integral_constant<bool, is_convertible<_Alloc,
  7192.          typename _Tp::allocator_type>::value>
  7193.     { };
  7194.   template<typename _Tp, typename _Alloc>
  7195.     struct uses_allocator
  7196.     : public integral_constant<bool,
  7197.           __uses_allocator_helper<_Tp, _Alloc>::value>
  7198.     { };
  7199.   template<typename _Tp, typename _Alloc, typename... _Args>
  7200.     struct __uses_allocator_arg
  7201.     : is_constructible<_Tp, _Alloc, _Args...>
  7202.     { static_assert( uses_allocator<_Tp, _Alloc>::value, "uses allocator" ); };
  7203.   struct __uses_alloc_base { };
  7204.   struct __uses_alloc0 : __uses_alloc_base
  7205.   { struct _Anything { _Anything(...) { } } _M_a; };
  7206.   template<typename _Alloc>
  7207.     struct __uses_alloc1 : __uses_alloc_base { const _Alloc* _M_a; };
  7208.   template<typename _Alloc>
  7209.     struct __uses_alloc2 : __uses_alloc_base { const _Alloc* _M_a; };
  7210.   template<bool, typename _Alloc, typename... _Args>
  7211.     struct __uses_alloc;
  7212.   template<typename _Tp, typename _Alloc, typename... _Args>
  7213.     struct __uses_alloc<true, _Tp, _Alloc, _Args...>
  7214.     : conditional<
  7215.         is_constructible<_Tp, allocator_arg_t, _Alloc, _Args...>::value,
  7216.         __uses_alloc1<_Alloc>,
  7217.         __uses_alloc2<_Alloc>>::type
  7218.     { };
  7219.   template<typename _Tp, typename _Alloc, typename... _Args>
  7220.     struct __uses_alloc<false, _Tp, _Alloc, _Args...>
  7221.     : __uses_alloc0 { };
  7222.   template<typename _Tp, typename _Alloc, typename... _Args>
  7223.     struct __uses_alloc_impl
  7224.     : __uses_alloc<uses_allocator<_Tp, _Alloc>::value, _Tp, _Alloc, _Args...>
  7225.     { };
  7226.   template<typename _Tp, typename _Alloc, typename... _Args>
  7227.     __uses_alloc_impl<_Tp, _Alloc, _Args...>
  7228.     __use_alloc(const _Alloc& __a)
  7229.     {
  7230.       __uses_alloc_impl<_Tp, _Alloc, _Args...> __ret;
  7231.       __ret._M_a = &__a;
  7232.       return __ret;
  7233.     }
  7234.  
  7235. }
  7236.        
  7237.        
  7238.        
  7239. namespace std __attribute__ ((__visibility__ ("default")))
  7240. {
  7241.   namespace rel_ops
  7242.   {
  7243.  
  7244.     template <class _Tp>
  7245.       inline bool
  7246.       operator!=(const _Tp& __x, const _Tp& __y)
  7247.       { return !(__x == __y); }
  7248.     template <class _Tp>
  7249.       inline bool
  7250.       operator>(const _Tp& __x, const _Tp& __y)
  7251.       { return __y < __x; }
  7252.     template <class _Tp>
  7253.       inline bool
  7254.       operator<=(const _Tp& __x, const _Tp& __y)
  7255.       { return !(__y < __x); }
  7256.     template <class _Tp>
  7257.       inline bool
  7258.       operator>=(const _Tp& __x, const _Tp& __y)
  7259.       { return !(__x < __y); }
  7260.  
  7261.   }
  7262. }
  7263.        
  7264. #pragma GCC visibility push(default)
  7265. namespace std
  7266. {
  7267.   template<class _E>
  7268.     class initializer_list
  7269.     {
  7270.     public:
  7271.       typedef _E value_type;
  7272.       typedef const _E& reference;
  7273.       typedef const _E& const_reference;
  7274.       typedef size_t size_type;
  7275.       typedef const _E* iterator;
  7276.       typedef const _E* const_iterator;
  7277.     private:
  7278.       iterator _M_array;
  7279.       size_type _M_len;
  7280.       constexpr initializer_list(const_iterator __a, size_type __l)
  7281.       : _M_array(__a), _M_len(__l) { }
  7282.     public:
  7283.       constexpr initializer_list() noexcept
  7284.       : _M_array(0), _M_len(0) { }
  7285.       constexpr size_type
  7286.       size() const noexcept { return _M_len; }
  7287.       constexpr const_iterator
  7288.       begin() const noexcept { return _M_array; }
  7289.       constexpr const_iterator
  7290.       end() const noexcept { return begin() + size(); }
  7291.   };
  7292.   template<class _Tp>
  7293.     constexpr const _Tp*
  7294.     begin(initializer_list<_Tp> __ils) noexcept
  7295.     { return __ils.begin(); }
  7296.   template<class _Tp>
  7297.     constexpr const _Tp*
  7298.     end(initializer_list<_Tp> __ils) noexcept
  7299.     { return __ils.end(); }
  7300. }
  7301. #pragma GCC visibility pop
  7302. namespace std __attribute__ ((__visibility__ ("default")))
  7303. {
  7304.  
  7305.   template<class _Tp>
  7306.     class tuple_size;
  7307.   template<std::size_t _Int, class _Tp>
  7308.     class tuple_element;
  7309.   template<class _Tp1, class _Tp2>
  7310.     struct tuple_size<std::pair<_Tp1, _Tp2>>
  7311.     : public integral_constant<std::size_t, 2> { };
  7312.   template<class _Tp1, class _Tp2>
  7313.     struct tuple_element<0, std::pair<_Tp1, _Tp2>>
  7314.     { typedef _Tp1 type; };
  7315.   template<class _Tp1, class _Tp2>
  7316.     struct tuple_element<1, std::pair<_Tp1, _Tp2>>
  7317.     { typedef _Tp2 type; };
  7318.   template<std::size_t _Int>
  7319.     struct __pair_get;
  7320.   template<>
  7321.     struct __pair_get<0>
  7322.     {
  7323.       template<typename _Tp1, typename _Tp2>
  7324.         static constexpr _Tp1&
  7325.         __get(std::pair<_Tp1, _Tp2>& __pair) noexcept
  7326.         { return __pair.first; }
  7327.       template<typename _Tp1, typename _Tp2>
  7328.         static constexpr _Tp1&&
  7329.         __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept
  7330.         { return std::forward<_Tp1>(__pair.first); }
  7331.       template<typename _Tp1, typename _Tp2>
  7332.         static constexpr const _Tp1&
  7333.         __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept
  7334.         { return __pair.first; }
  7335.     };
  7336.   template<>
  7337.     struct __pair_get<1>
  7338.     {
  7339.       template<typename _Tp1, typename _Tp2>
  7340.         static constexpr _Tp2&
  7341.         __get(std::pair<_Tp1, _Tp2>& __pair) noexcept
  7342.         { return __pair.second; }
  7343.       template<typename _Tp1, typename _Tp2>
  7344.         static constexpr _Tp2&&
  7345.         __move_get(std::pair<_Tp1, _Tp2>&& __pair) noexcept
  7346.         { return std::forward<_Tp2>(__pair.second); }
  7347.       template<typename _Tp1, typename _Tp2>
  7348.         static constexpr const _Tp2&
  7349.         __const_get(const std::pair<_Tp1, _Tp2>& __pair) noexcept
  7350.         { return __pair.second; }
  7351.     };
  7352.   template<std::size_t _Int, class _Tp1, class _Tp2>
  7353.     constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&
  7354.     get(std::pair<_Tp1, _Tp2>& __in) noexcept
  7355.     { return __pair_get<_Int>::__get(__in); }
  7356.   template<std::size_t _Int, class _Tp1, class _Tp2>
  7357.     constexpr typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&&
  7358.     get(std::pair<_Tp1, _Tp2>&& __in) noexcept
  7359.     { return __pair_get<_Int>::__move_get(std::move(__in)); }
  7360.   template<std::size_t _Int, class _Tp1, class _Tp2>
  7361.     constexpr const typename tuple_element<_Int, std::pair<_Tp1, _Tp2>>::type&
  7362.     get(const std::pair<_Tp1, _Tp2>& __in) noexcept
  7363.     { return __pair_get<_Int>::__const_get(__in); }
  7364.  
  7365. }
  7366. namespace std __attribute__ ((__visibility__ ("default")))
  7367. {
  7368.  
  7369.   template<typename _Tp>
  7370.     struct __add_c_ref
  7371.     { typedef const _Tp& type; };
  7372.   template<typename _Tp>
  7373.     struct __add_c_ref<_Tp&>
  7374.     { typedef _Tp& type; };
  7375.   template<typename _Tp>
  7376.     struct __add_ref
  7377.     { typedef _Tp& type; };
  7378.   template<typename _Tp>
  7379.     struct __add_ref<_Tp&>
  7380.     { typedef _Tp& type; };
  7381.   template<typename _Tp>
  7382.     struct __add_r_ref
  7383.     { typedef _Tp&& type; };
  7384.   template<typename _Tp>
  7385.     struct __add_r_ref<_Tp&>
  7386.     { typedef _Tp& type; };
  7387.   template<std::size_t _Idx, typename _Head, bool _IsEmptyNotFinal>
  7388.     struct _Head_base;
  7389.   template<std::size_t _Idx, typename _Head>
  7390.     struct _Head_base<_Idx, _Head, true>
  7391.     : public _Head
  7392.     {
  7393.       constexpr _Head_base()
  7394.       : _Head() { }
  7395.       constexpr _Head_base(const _Head& __h)
  7396.       : _Head(__h) { }
  7397.       template<typename _UHead, typename = typename
  7398.         enable_if<!is_convertible<_UHead,
  7399.                                   __uses_alloc_base>::value>::type>
  7400.         constexpr _Head_base(_UHead&& __h)
  7401.  : _Head(std::forward<_UHead>(__h)) { }
  7402.       _Head_base(__uses_alloc0)
  7403.       : _Head() { }
  7404.       template<typename _Alloc>
  7405.  _Head_base(__uses_alloc1<_Alloc> __a)
  7406.  : _Head(allocator_arg, *__a._M_a) { }
  7407.       template<typename _Alloc>
  7408.  _Head_base(__uses_alloc2<_Alloc> __a)
  7409.  : _Head(*__a._M_a) { }
  7410.       template<typename _UHead>
  7411.  _Head_base(__uses_alloc0, _UHead&& __uhead)
  7412.  : _Head(std::forward<_UHead>(__uhead)) { }
  7413.       template<typename _Alloc, typename _UHead>
  7414.  _Head_base(__uses_alloc1<_Alloc> __a, _UHead&& __uhead)
  7415.  : _Head(allocator_arg, *__a._M_a, std::forward<_UHead>(__uhead)) { }
  7416.       template<typename _Alloc, typename _UHead>
  7417.  _Head_base(__uses_alloc2<_Alloc> __a, _UHead&& __uhead)
  7418.  : _Head(std::forward<_UHead>(__uhead), *__a._M_a) { }
  7419.       static constexpr _Head&
  7420.       _M_head(_Head_base& __b) noexcept { return __b; }
  7421.       static constexpr const _Head&
  7422.       _M_head(const _Head_base& __b) noexcept { return __b; }
  7423.     };
  7424.   template<std::size_t _Idx, typename _Head>
  7425.     struct _Head_base<_Idx, _Head, false>
  7426.     {
  7427.       constexpr _Head_base()
  7428.       : _M_head_impl() { }
  7429.       constexpr _Head_base(const _Head& __h)
  7430.       : _M_head_impl(__h) { }
  7431.       template<typename _UHead, typename = typename
  7432.         enable_if<!is_convertible<_UHead,
  7433.                                   __uses_alloc_base>::value>::type>
  7434.         constexpr _Head_base(_UHead&& __h)
  7435.  : _M_head_impl(std::forward<_UHead>(__h)) { }
  7436.       _Head_base(__uses_alloc0)
  7437.       : _M_head_impl() { }
  7438.       template<typename _Alloc>
  7439.  _Head_base(__uses_alloc1<_Alloc> __a)
  7440.  : _M_head_impl(allocator_arg, *__a._M_a) { }
  7441.       template<typename _Alloc>
  7442.  _Head_base(__uses_alloc2<_Alloc> __a)
  7443.  : _M_head_impl(*__a._M_a) { }
  7444.       template<typename _UHead>
  7445.  _Head_base(__uses_alloc0, _UHead&& __uhead)
  7446.  : _M_head_impl(std::forward<_UHead>(__uhead)) { }
  7447.       template<typename _Alloc, typename _UHead>
  7448.  _Head_base(__uses_alloc1<_Alloc> __a, _UHead&& __uhead)
  7449.  : _M_head_impl(allocator_arg, *__a._M_a, std::forward<_UHead>(__uhead))
  7450.  { }
  7451.       template<typename _Alloc, typename _UHead>
  7452.  _Head_base(__uses_alloc2<_Alloc> __a, _UHead&& __uhead)
  7453.  : _M_head_impl(std::forward<_UHead>(__uhead), *__a._M_a) { }
  7454.       static constexpr _Head&
  7455.       _M_head(_Head_base& __b) noexcept { return __b._M_head_impl; }
  7456.       static constexpr const _Head&
  7457.       _M_head(const _Head_base& __b) noexcept { return __b._M_head_impl; }
  7458.       _Head _M_head_impl;
  7459.     };
  7460.   template<std::size_t _Idx, typename... _Elements>
  7461.     struct _Tuple_impl;
  7462.   template<std::size_t _Idx>
  7463.     struct _Tuple_impl<_Idx>
  7464.     {
  7465.       template<std::size_t, typename...> friend class _Tuple_impl;
  7466.       _Tuple_impl() = default;
  7467.       template<typename _Alloc>
  7468.         _Tuple_impl(allocator_arg_t, const _Alloc&) { }
  7469.       template<typename _Alloc>
  7470.         _Tuple_impl(allocator_arg_t, const _Alloc&, const _Tuple_impl&) { }
  7471.       template<typename _Alloc>
  7472.         _Tuple_impl(allocator_arg_t, const _Alloc&, _Tuple_impl&&) { }
  7473.     protected:
  7474.       void _M_swap(_Tuple_impl&) noexcept { }
  7475.     };
  7476.   template<typename _Tp>
  7477.     using __empty_not_final
  7478.       = typename conditional<__is_final(_Tp), false_type, is_empty<_Tp>>::type;
  7479.   template<std::size_t _Idx, typename _Head, typename... _Tail>
  7480.     struct _Tuple_impl<_Idx, _Head, _Tail...>
  7481.     : public _Tuple_impl<_Idx + 1, _Tail...>,
  7482.       private _Head_base<_Idx, _Head, __empty_not_final<_Head>::value>
  7483.     {
  7484.       template<std::size_t, typename...> friend class _Tuple_impl;
  7485.       typedef _Tuple_impl<_Idx + 1, _Tail...> _Inherited;
  7486.       typedef _Head_base<_Idx, _Head, __empty_not_final<_Head>::value> _Base;
  7487.       static constexpr _Head&
  7488.       _M_head(_Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
  7489.       static constexpr const _Head&
  7490.       _M_head(const _Tuple_impl& __t) noexcept { return _Base::_M_head(__t); }
  7491.       static constexpr _Inherited&
  7492.       _M_tail(_Tuple_impl& __t) noexcept { return __t; }
  7493.       static constexpr const _Inherited&
  7494.       _M_tail(const _Tuple_impl& __t) noexcept { return __t; }
  7495.       constexpr _Tuple_impl()
  7496.       : _Inherited(), _Base() { }
  7497.       explicit
  7498.       constexpr _Tuple_impl(const _Head& __head, const _Tail&... __tail)
  7499.       : _Inherited(__tail...), _Base(__head) { }
  7500.       template<typename _UHead, typename... _UTail, typename = typename
  7501.                enable_if<sizeof...(_Tail) == sizeof...(_UTail)>::type>
  7502.         explicit
  7503.         constexpr _Tuple_impl(_UHead&& __head, _UTail&&... __tail)
  7504.  : _Inherited(std::forward<_UTail>(__tail)...),
  7505.    _Base(std::forward<_UHead>(__head)) { }
  7506.       constexpr _Tuple_impl(const _Tuple_impl&) = default;
  7507.       constexpr
  7508.       _Tuple_impl(_Tuple_impl&& __in)
  7509.       noexcept(__and_<is_nothrow_move_constructible<_Head>,
  7510.                is_nothrow_move_constructible<_Inherited>>::value)
  7511.       : _Inherited(std::move(_M_tail(__in))),
  7512.  _Base(std::forward<_Head>(_M_head(__in))) { }
  7513.       template<typename... _UElements>
  7514.         constexpr _Tuple_impl(const _Tuple_impl<_Idx, _UElements...>& __in)
  7515.  : _Inherited(_Tuple_impl<_Idx, _UElements...>::_M_tail(__in)),
  7516.    _Base(_Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { }
  7517.       template<typename _UHead, typename... _UTails>
  7518.         constexpr _Tuple_impl(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in)
  7519.  : _Inherited(std::move
  7520.        (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))),
  7521.    _Base(std::forward<_UHead>
  7522.   (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { }
  7523.       template<typename _Alloc>
  7524.  _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a)
  7525.  : _Inherited(__tag, __a),
  7526.           _Base(__use_alloc<_Head>(__a)) { }
  7527.       template<typename _Alloc>
  7528.  _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
  7529.       const _Head& __head, const _Tail&... __tail)
  7530.  : _Inherited(__tag, __a, __tail...),
  7531.           _Base(__use_alloc<_Head, _Alloc, _Head>(__a), __head) { }
  7532.       template<typename _Alloc, typename _UHead, typename... _UTail,
  7533.                typename = typename enable_if<sizeof...(_Tail)
  7534.           == sizeof...(_UTail)>::type>
  7535.  _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
  7536.              _UHead&& __head, _UTail&&... __tail)
  7537.  : _Inherited(__tag, __a, std::forward<_UTail>(__tail)...),
  7538.           _Base(__use_alloc<_Head, _Alloc, _UHead>(__a),
  7539.          std::forward<_UHead>(__head)) { }
  7540.       template<typename _Alloc>
  7541.         _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
  7542.              const _Tuple_impl& __in)
  7543.  : _Inherited(__tag, __a, _M_tail(__in)),
  7544.           _Base(__use_alloc<_Head, _Alloc, _Head>(__a), _M_head(__in)) { }
  7545.       template<typename _Alloc>
  7546.  _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
  7547.              _Tuple_impl&& __in)
  7548.  : _Inherited(__tag, __a, std::move(_M_tail(__in))),
  7549.    _Base(__use_alloc<_Head, _Alloc, _Head>(__a),
  7550.          std::forward<_Head>(_M_head(__in))) { }
  7551.       template<typename _Alloc, typename... _UElements>
  7552.  _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
  7553.              const _Tuple_impl<_Idx, _UElements...>& __in)
  7554.  : _Inherited(__tag, __a,
  7555.        _Tuple_impl<_Idx, _UElements...>::_M_tail(__in)),
  7556.    _Base(__use_alloc<_Head, _Alloc, _Head>(__a),
  7557.   _Tuple_impl<_Idx, _UElements...>::_M_head(__in)) { }
  7558.       template<typename _Alloc, typename _UHead, typename... _UTails>
  7559.  _Tuple_impl(allocator_arg_t __tag, const _Alloc& __a,
  7560.              _Tuple_impl<_Idx, _UHead, _UTails...>&& __in)
  7561.  : _Inherited(__tag, __a, std::move
  7562.        (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in))),
  7563.    _Base(__use_alloc<_Head, _Alloc, _UHead>(__a),
  7564.                 std::forward<_UHead>
  7565.   (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in))) { }
  7566.       _Tuple_impl&
  7567.       operator=(const _Tuple_impl& __in)
  7568.       {
  7569.  _M_head(*this) = _M_head(__in);
  7570.  _M_tail(*this) = _M_tail(__in);
  7571.  return *this;
  7572.       }
  7573.       _Tuple_impl&
  7574.       operator=(_Tuple_impl&& __in)
  7575.       noexcept(__and_<is_nothrow_move_assignable<_Head>,
  7576.                is_nothrow_move_assignable<_Inherited>>::value)
  7577.       {
  7578.  _M_head(*this) = std::forward<_Head>(_M_head(__in));
  7579.  _M_tail(*this) = std::move(_M_tail(__in));
  7580.  return *this;
  7581.       }
  7582.       template<typename... _UElements>
  7583.         _Tuple_impl&
  7584.         operator=(const _Tuple_impl<_Idx, _UElements...>& __in)
  7585.         {
  7586.    _M_head(*this) = _Tuple_impl<_Idx, _UElements...>::_M_head(__in);
  7587.    _M_tail(*this) = _Tuple_impl<_Idx, _UElements...>::_M_tail(__in);
  7588.    return *this;
  7589.  }
  7590.       template<typename _UHead, typename... _UTails>
  7591.         _Tuple_impl&
  7592.         operator=(_Tuple_impl<_Idx, _UHead, _UTails...>&& __in)
  7593.         {
  7594.    _M_head(*this) = std::forward<_UHead>
  7595.      (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_head(__in));
  7596.    _M_tail(*this) = std::move
  7597.      (_Tuple_impl<_Idx, _UHead, _UTails...>::_M_tail(__in));
  7598.    return *this;
  7599.  }
  7600.     protected:
  7601.       void
  7602.       _M_swap(_Tuple_impl& __in)
  7603.       noexcept(noexcept(swap(std::declval<_Head&>(),
  7604.         std::declval<_Head&>()))
  7605.         && noexcept(_M_tail(__in)._M_swap(_M_tail(__in))))
  7606.       {
  7607.  using std::swap;
  7608.  swap(_M_head(*this), _M_head(__in));
  7609.  _Inherited::_M_swap(_M_tail(__in));
  7610.       }
  7611.     };
  7612.   template<typename... _Elements>
  7613.     class tuple : public _Tuple_impl<0, _Elements...>
  7614.     {
  7615.       typedef _Tuple_impl<0, _Elements...> _Inherited;
  7616.     public:
  7617.       constexpr tuple()
  7618.       : _Inherited() { }
  7619.       explicit
  7620.       constexpr tuple(const _Elements&... __elements)
  7621.       : _Inherited(__elements...) { }
  7622.       template<typename... _UElements, typename = typename
  7623.         enable_if<__and_<is_convertible<_UElements,
  7624.      _Elements>...>::value>::type>
  7625.  explicit
  7626.         constexpr tuple(_UElements&&... __elements)
  7627.  : _Inherited(std::forward<_UElements>(__elements)...) { }
  7628.       constexpr tuple(const tuple&) = default;
  7629.       constexpr tuple(tuple&&) = default;
  7630.       template<typename... _UElements, typename = typename
  7631.         enable_if<__and_<is_convertible<const _UElements&,
  7632.      _Elements>...>::value>::type>
  7633.         constexpr tuple(const tuple<_UElements...>& __in)
  7634.         : _Inherited(static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
  7635.         { }
  7636.       template<typename... _UElements, typename = typename
  7637.         enable_if<__and_<is_convertible<_UElements,
  7638.      _Elements>...>::value>::type>
  7639.         constexpr tuple(tuple<_UElements...>&& __in)
  7640.         : _Inherited(static_cast<_Tuple_impl<0, _UElements...>&&>(__in)) { }
  7641.       template<typename _Alloc>
  7642.  tuple(allocator_arg_t __tag, const _Alloc& __a)
  7643.  : _Inherited(__tag, __a) { }
  7644.       template<typename _Alloc>
  7645.  tuple(allocator_arg_t __tag, const _Alloc& __a,
  7646.        const _Elements&... __elements)
  7647.  : _Inherited(__tag, __a, __elements...) { }
  7648.       template<typename _Alloc, typename... _UElements, typename = typename
  7649.         enable_if<sizeof...(_UElements)
  7650.     == sizeof...(_Elements)>::type>
  7651.  tuple(allocator_arg_t __tag, const _Alloc& __a,
  7652.        _UElements&&... __elements)
  7653.  : _Inherited(__tag, __a, std::forward<_UElements>(__elements)...)
  7654.         { }
  7655.       template<typename _Alloc>
  7656.  tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple& __in)
  7657.  : _Inherited(__tag, __a, static_cast<const _Inherited&>(__in)) { }
  7658.       template<typename _Alloc>
  7659.  tuple(allocator_arg_t __tag, const _Alloc& __a, tuple&& __in)
  7660.  : _Inherited(__tag, __a, static_cast<_Inherited&&>(__in)) { }
  7661.       template<typename _Alloc, typename... _UElements, typename = typename
  7662.         enable_if<sizeof...(_UElements)
  7663.     == sizeof...(_Elements)>::type>
  7664.  tuple(allocator_arg_t __tag, const _Alloc& __a,
  7665.        const tuple<_UElements...>& __in)
  7666.  : _Inherited(__tag, __a,
  7667.               static_cast<const _Tuple_impl<0, _UElements...>&>(__in))
  7668.  { }
  7669.       template<typename _Alloc, typename... _UElements, typename = typename
  7670.         enable_if<sizeof...(_UElements)
  7671.     == sizeof...(_Elements)>::type>
  7672.  tuple(allocator_arg_t __tag, const _Alloc& __a,
  7673.        tuple<_UElements...>&& __in)
  7674.  : _Inherited(__tag, __a,
  7675.               static_cast<_Tuple_impl<0, _UElements...>&&>(__in))
  7676.  { }
  7677.       tuple&
  7678.       operator=(const tuple& __in)
  7679.       {
  7680.  static_cast<_Inherited&>(*this) = __in;
  7681.  return *this;
  7682.       }
  7683.       tuple&
  7684.       operator=(tuple&& __in)
  7685.       noexcept(is_nothrow_move_assignable<_Inherited>::value)
  7686.       {
  7687.  static_cast<_Inherited&>(*this) = std::move(__in);
  7688.  return *this;
  7689.       }
  7690.       template<typename... _UElements, typename = typename
  7691.         enable_if<sizeof...(_UElements)
  7692.     == sizeof...(_Elements)>::type>
  7693.         tuple&
  7694.         operator=(const tuple<_UElements...>& __in)
  7695.         {
  7696.    static_cast<_Inherited&>(*this) = __in;
  7697.    return *this;
  7698.  }
  7699.       template<typename... _UElements, typename = typename
  7700.         enable_if<sizeof...(_UElements)
  7701.     == sizeof...(_Elements)>::type>
  7702.         tuple&
  7703.         operator=(tuple<_UElements...>&& __in)
  7704.         {
  7705.    static_cast<_Inherited&>(*this) = std::move(__in);
  7706.    return *this;
  7707.  }
  7708.       void
  7709.       swap(tuple& __in)
  7710.       noexcept(noexcept(__in._M_swap(__in)))
  7711.       { _Inherited::_M_swap(__in); }
  7712.     };
  7713.   template<>
  7714.     class tuple<>
  7715.     {
  7716.     public:
  7717.       void swap(tuple&) noexcept { }
  7718.     };
  7719.   template<typename _T1, typename _T2>
  7720.     class tuple<_T1, _T2> : public _Tuple_impl<0, _T1, _T2>
  7721.     {
  7722.       typedef _Tuple_impl<0, _T1, _T2> _Inherited;
  7723.     public:
  7724.       constexpr tuple()
  7725.       : _Inherited() { }
  7726.       explicit
  7727.       constexpr tuple(const _T1& __a1, const _T2& __a2)
  7728.       : _Inherited(__a1, __a2) { }
  7729.       template<typename _U1, typename _U2, typename = typename
  7730.         enable_if<__and_<is_convertible<_U1, _T1>,
  7731.     is_convertible<_U2, _T2>>::value>::type>
  7732.         explicit
  7733.         constexpr tuple(_U1&& __a1, _U2&& __a2)
  7734.  : _Inherited(std::forward<_U1>(__a1), std::forward<_U2>(__a2)) { }
  7735.       constexpr tuple(const tuple&) = default;
  7736.       constexpr tuple(tuple&&) = default;
  7737.       template<typename _U1, typename _U2, typename = typename
  7738.  enable_if<__and_<is_convertible<const _U1&, _T1>,
  7739.     is_convertible<const _U2&, _T2>>::value>::type>
  7740.         constexpr tuple(const tuple<_U1, _U2>& __in)
  7741.  : _Inherited(static_cast<const _Tuple_impl<0, _U1, _U2>&>(__in)) { }
  7742.       template<typename _U1, typename _U2, typename = typename
  7743.         enable_if<__and_<is_convertible<_U1, _T1>,
  7744.     is_convertible<_U2, _T2>>::value>::type>
  7745.         constexpr tuple(tuple<_U1, _U2>&& __in)
  7746.  : _Inherited(static_cast<_Tuple_impl<0, _U1, _U2>&&>(__in)) { }
  7747.       template<typename _U1, typename _U2, typename = typename
  7748.  enable_if<__and_<is_convertible<const _U1&, _T1>,
  7749.     is_convertible<const _U2&, _T2>>::value>::type>
  7750.         constexpr tuple(const pair<_U1, _U2>& __in)
  7751.  : _Inherited(__in.first, __in.second) { }
  7752.       template<typename _U1, typename _U2, typename = typename
  7753.         enable_if<__and_<is_convertible<_U1, _T1>,
  7754.     is_convertible<_U2, _T2>>::value>::type>
  7755.         constexpr tuple(pair<_U1, _U2>&& __in)
  7756.  : _Inherited(std::forward<_U1>(__in.first),
  7757.        std::forward<_U2>(__in.second)) { }
  7758.       template<typename _Alloc>
  7759.  tuple(allocator_arg_t __tag, const _Alloc& __a)
  7760.  : _Inherited(__tag, __a) { }
  7761.       template<typename _Alloc>
  7762.  tuple(allocator_arg_t __tag, const _Alloc& __a,
  7763.        const _T1& __a1, const _T2& __a2)
  7764.  : _Inherited(__tag, __a, __a1, __a2) { }
  7765.       template<typename _Alloc, typename _U1, typename _U2>
  7766.  tuple(allocator_arg_t __tag, const _Alloc& __a, _U1&& __a1, _U2&& __a2)
  7767.  : _Inherited(__tag, __a, std::forward<_U1>(__a1),
  7768.               std::forward<_U2>(__a2)) { }
  7769.       template<typename _Alloc>
  7770.  tuple(allocator_arg_t __tag, const _Alloc& __a, const tuple& __in)
  7771.  : _Inherited(__tag, __a, static_cast<const _Inherited&>(__in)) { }
  7772.       template<typename _Alloc>
  7773.  tuple(allocator_arg_t __tag, const _Alloc& __a, tuple&& __in)
  7774.  : _Inherited(__tag, __a, static_cast<_Inherited&&>(__in)) { }
  7775.       template<typename _Alloc, typename _U1, typename _U2>
  7776.  tuple(allocator_arg_t __tag, const _Alloc& __a,
  7777.        const tuple<_U1, _U2>& __in)
  7778.  : _Inherited(__tag, __a,
  7779.               static_cast<const _Tuple_impl<0, _U1, _U2>&>(__in))
  7780.  { }
  7781.       template<typename _Alloc, typename _U1, typename _U2>
  7782.  tuple(allocator_arg_t __tag, const _Alloc& __a, tuple<_U1, _U2>&& __in)
  7783.  : _Inherited(__tag, __a, static_cast<_Tuple_impl<0, _U1, _U2>&&>(__in))
  7784.  { }
  7785.       template<typename _Alloc, typename _U1, typename _U2>
  7786.         tuple(allocator_arg_t __tag, const _Alloc& __a,
  7787.        const pair<_U1, _U2>& __in)
  7788.  : _Inherited(__tag, __a, __in.first, __in.second) { }
  7789.       template<typename _Alloc, typename _U1, typename _U2>
  7790.         tuple(allocator_arg_t __tag, const _Alloc& __a, pair<_U1, _U2>&& __in)
  7791.  : _Inherited(__tag, __a, std::forward<_U1>(__in.first),
  7792.        std::forward<_U2>(__in.second)) { }
  7793.       tuple&
  7794.       operator=(const tuple& __in)
  7795.       {
  7796.  static_cast<_Inherited&>(*this) = __in;
  7797.  return *this;
  7798.       }
  7799.       tuple&
  7800.       operator=(tuple&& __in)
  7801.       noexcept(is_nothrow_move_assignable<_Inherited>::value)
  7802.       {
  7803.  static_cast<_Inherited&>(*this) = std::move(__in);
  7804.  return *this;
  7805.       }
  7806.       template<typename _U1, typename _U2>
  7807.         tuple&
  7808.         operator=(const tuple<_U1, _U2>& __in)
  7809.         {
  7810.    static_cast<_Inherited&>(*this) = __in;
  7811.    return *this;
  7812.  }
  7813.       template<typename _U1, typename _U2>
  7814.         tuple&
  7815.         operator=(tuple<_U1, _U2>&& __in)
  7816.         {
  7817.    static_cast<_Inherited&>(*this) = std::move(__in);
  7818.    return *this;
  7819.  }
  7820.       template<typename _U1, typename _U2>
  7821.         tuple&
  7822.         operator=(const pair<_U1, _U2>& __in)
  7823.         {
  7824.    this->_M_head(*this) = __in.first;
  7825.    this->_M_tail(*this)._M_head(*this) = __in.second;
  7826.    return *this;
  7827.  }
  7828.       template<typename _U1, typename _U2>
  7829.         tuple&
  7830.         operator=(pair<_U1, _U2>&& __in)
  7831.         {
  7832.    this->_M_head(*this) = std::forward<_U1>(__in.first);
  7833.    this->_M_tail(*this)._M_head(*this) = std::forward<_U2>(__in.second);
  7834.    return *this;
  7835.  }
  7836.       void
  7837.       swap(tuple& __in)
  7838.       noexcept(noexcept(__in._M_swap(__in)))
  7839.       { _Inherited::_M_swap(__in); }
  7840.     };
  7841.   template<std::size_t __i, typename _Tp>
  7842.     struct tuple_element;
  7843.   template<std::size_t __i, typename _Head, typename... _Tail>
  7844.     struct tuple_element<__i, tuple<_Head, _Tail...> >
  7845.     : tuple_element<__i - 1, tuple<_Tail...> > { };
  7846.   template<typename _Head, typename... _Tail>
  7847.     struct tuple_element<0, tuple<_Head, _Tail...> >
  7848.     {
  7849.       typedef _Head type;
  7850.     };
  7851.   template<std::size_t __i, typename _Tp>
  7852.     struct tuple_element<__i, const _Tp>
  7853.     {
  7854.       typedef typename
  7855.       add_const<typename tuple_element<__i, _Tp>::type>::type type;
  7856.     };
  7857.   template<std::size_t __i, typename _Tp>
  7858.     struct tuple_element<__i, volatile _Tp>
  7859.     {
  7860.       typedef typename
  7861.       add_volatile<typename tuple_element<__i, _Tp>::type>::type type;
  7862.     };
  7863.   template<std::size_t __i, typename _Tp>
  7864.     struct tuple_element<__i, const volatile _Tp>
  7865.     {
  7866.       typedef typename
  7867.       add_cv<typename tuple_element<__i, _Tp>::type>::type type;
  7868.     };
  7869.   template<typename _Tp>
  7870.     struct tuple_size;
  7871.   template<typename _Tp>
  7872.     struct tuple_size<const _Tp>
  7873.     : public integral_constant<
  7874.              typename remove_cv<decltype(tuple_size<_Tp>::value)>::type,
  7875.              tuple_size<_Tp>::value> { };
  7876.   template<typename _Tp>
  7877.     struct tuple_size<volatile _Tp>
  7878.     : public integral_constant<
  7879.              typename remove_cv<decltype(tuple_size<_Tp>::value)>::type,
  7880.              tuple_size<_Tp>::value> { };
  7881.   template<typename _Tp>
  7882.     struct tuple_size<const volatile _Tp>
  7883.     : public integral_constant<
  7884.              typename remove_cv<decltype(tuple_size<_Tp>::value)>::type,
  7885.              tuple_size<_Tp>::value> { };
  7886.   template<typename... _Elements>
  7887.     struct tuple_size<tuple<_Elements...>>
  7888.     : public integral_constant<std::size_t, sizeof...(_Elements)> { };
  7889.   template<std::size_t __i, typename _Head, typename... _Tail>
  7890.     constexpr typename __add_ref<_Head>::type
  7891.     __get_helper(_Tuple_impl<__i, _Head, _Tail...>& __t) noexcept
  7892.     { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); }
  7893.   template<std::size_t __i, typename _Head, typename... _Tail>
  7894.     constexpr typename __add_c_ref<_Head>::type
  7895.     __get_helper(const _Tuple_impl<__i, _Head, _Tail...>& __t) noexcept
  7896.     { return _Tuple_impl<__i, _Head, _Tail...>::_M_head(__t); }
  7897.   template<std::size_t __i, typename... _Elements>
  7898.     constexpr typename __add_ref<
  7899.                       typename tuple_element<__i, tuple<_Elements...>>::type
  7900.                     >::type
  7901.     get(tuple<_Elements...>& __t) noexcept
  7902.     { return __get_helper<__i>(__t); }
  7903.   template<std::size_t __i, typename... _Elements>
  7904.     constexpr typename __add_c_ref<
  7905.                       typename tuple_element<__i, tuple<_Elements...>>::type
  7906.                     >::type
  7907.     get(const tuple<_Elements...>& __t) noexcept
  7908.     { return __get_helper<__i>(__t); }
  7909.   template<std::size_t __i, typename... _Elements>
  7910.     constexpr typename __add_r_ref<
  7911.                       typename tuple_element<__i, tuple<_Elements...>>::type
  7912.                     >::type
  7913.     get(tuple<_Elements...>&& __t) noexcept
  7914.     { return std::forward<typename tuple_element<__i,
  7915.  tuple<_Elements...>>::type&&>(get<__i>(__t)); }
  7916.   template<std::size_t __check_equal_size, std::size_t __i, std::size_t __j,
  7917.     typename _Tp, typename _Up>
  7918.     struct __tuple_compare;
  7919.   template<std::size_t __i, std::size_t __j, typename _Tp, typename _Up>
  7920.     struct __tuple_compare<0, __i, __j, _Tp, _Up>
  7921.     {
  7922.       static bool
  7923.       __eq(const _Tp& __t, const _Up& __u)
  7924.       {
  7925.  return (get<__i>(__t) == get<__i>(__u) &&
  7926.   __tuple_compare<0, __i + 1, __j, _Tp, _Up>::__eq(__t, __u));
  7927.       }
  7928.       static bool
  7929.       __less(const _Tp& __t, const _Up& __u)
  7930.       {
  7931.  return ((get<__i>(__t) < get<__i>(__u))
  7932.   || !(get<__i>(__u) < get<__i>(__t)) &&
  7933.   __tuple_compare<0, __i + 1, __j, _Tp, _Up>::__less(__t, __u));
  7934.       }
  7935.     };
  7936.   template<std::size_t __i, typename _Tp, typename _Up>
  7937.     struct __tuple_compare<0, __i, __i, _Tp, _Up>
  7938.     {
  7939.       static bool
  7940.       __eq(const _Tp&, const _Up&) { return true; }
  7941.       static bool
  7942.       __less(const _Tp&, const _Up&) { return false; }
  7943.     };
  7944.   template<typename... _TElements, typename... _UElements>
  7945.     bool
  7946.     operator==(const tuple<_TElements...>& __t,
  7947.         const tuple<_UElements...>& __u)
  7948.     {
  7949.       typedef tuple<_TElements...> _Tp;
  7950.       typedef tuple<_UElements...> _Up;
  7951.       return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
  7952.        0, tuple_size<_Tp>::value, _Tp, _Up>::__eq(__t, __u));
  7953.     }
  7954.   template<typename... _TElements, typename... _UElements>
  7955.     bool
  7956.     operator<(const tuple<_TElements...>& __t,
  7957.        const tuple<_UElements...>& __u)
  7958.     {
  7959.       typedef tuple<_TElements...> _Tp;
  7960.       typedef tuple<_UElements...> _Up;
  7961.       return (__tuple_compare<tuple_size<_Tp>::value - tuple_size<_Up>::value,
  7962.        0, tuple_size<_Tp>::value, _Tp, _Up>::__less(__t, __u));
  7963.     }
  7964.   template<typename... _TElements, typename... _UElements>
  7965.     inline bool
  7966.     operator!=(const tuple<_TElements...>& __t,
  7967.         const tuple<_UElements...>& __u)
  7968.     { return !(__t == __u); }
  7969.   template<typename... _TElements, typename... _UElements>
  7970.     inline bool
  7971.     operator>(const tuple<_TElements...>& __t,
  7972.        const tuple<_UElements...>& __u)
  7973.     { return __u < __t; }
  7974.   template<typename... _TElements, typename... _UElements>
  7975.     inline bool
  7976.     operator<=(const tuple<_TElements...>& __t,
  7977.         const tuple<_UElements...>& __u)
  7978.     { return !(__u < __t); }
  7979.   template<typename... _TElements, typename... _UElements>
  7980.     inline bool
  7981.     operator>=(const tuple<_TElements...>& __t,
  7982.         const tuple<_UElements...>& __u)
  7983.     { return !(__t < __u); }
  7984.   template<typename... _Elements>
  7985.     constexpr tuple<typename __decay_and_strip<_Elements>::__type...>
  7986.     make_tuple(_Elements&&... __args)
  7987.     {
  7988.       typedef tuple<typename __decay_and_strip<_Elements>::__type...>
  7989.  __result_type;
  7990.       return __result_type(std::forward<_Elements>(__args)...);
  7991.     }
  7992.   template<typename... _Elements>
  7993.     constexpr tuple<_Elements&&...>
  7994.     forward_as_tuple(_Elements&&... __args) noexcept
  7995.     { return tuple<_Elements&&...>(std::forward<_Elements>(__args)...); }
  7996.   template<typename, std::size_t> struct array;
  7997.   template<std::size_t _Int, typename _Tp, std::size_t _Nm>
  7998.     constexpr _Tp& get(array<_Tp, _Nm>&) noexcept;
  7999.   template<std::size_t _Int, typename _Tp, std::size_t _Nm>
  8000.     constexpr _Tp&& get(array<_Tp, _Nm>&&) noexcept;
  8001.   template<std::size_t _Int, typename _Tp, std::size_t _Nm>
  8002.     constexpr const _Tp& get(const array<_Tp, _Nm>&) noexcept;
  8003.   template<typename>
  8004.     struct __is_tuple_like_impl : false_type
  8005.     { };
  8006.   template<typename... _Tps>
  8007.     struct __is_tuple_like_impl<tuple<_Tps...>> : true_type
  8008.     { };
  8009.   template<typename _T1, typename _T2>
  8010.     struct __is_tuple_like_impl<pair<_T1, _T2>> : true_type
  8011.     { };
  8012.   template<typename _Tp, std::size_t _Nm>
  8013.     struct __is_tuple_like_impl<array<_Tp, _Nm>> : true_type
  8014.     { };
  8015.   template<typename _Tp>
  8016.     struct __is_tuple_like
  8017.     : public __is_tuple_like_impl<typename std::remove_cv
  8018.             <typename std::remove_reference<_Tp>::type>::type>::type
  8019.     { };
  8020.   template<std::size_t... _Indexes>
  8021.     struct _Index_tuple
  8022.     {
  8023.       typedef _Index_tuple<_Indexes..., sizeof...(_Indexes)> __next;
  8024.     };
  8025.   template<std::size_t _Num>
  8026.     struct _Build_index_tuple
  8027.     {
  8028.       typedef typename _Build_index_tuple<_Num - 1>::__type::__next __type;
  8029.     };
  8030.   template<>
  8031.     struct _Build_index_tuple<0>
  8032.     {
  8033.       typedef _Index_tuple<> __type;
  8034.     };
  8035.   template<std::size_t, typename, typename, std::size_t>
  8036.     struct __make_tuple_impl;
  8037.   template<std::size_t _Idx, typename _Tuple, typename... _Tp,
  8038.            std::size_t _Nm>
  8039.     struct __make_tuple_impl<_Idx, tuple<_Tp...>, _Tuple, _Nm>
  8040.     {
  8041.       typedef typename __make_tuple_impl<_Idx + 1, tuple<_Tp...,
  8042.  typename std::tuple_element<_Idx, _Tuple>::type>, _Tuple, _Nm>::__type
  8043.       __type;
  8044.     };
  8045.   template<std::size_t _Nm, typename _Tuple, typename... _Tp>
  8046.     struct __make_tuple_impl<_Nm, tuple<_Tp...>, _Tuple, _Nm>
  8047.     {
  8048.       typedef tuple<_Tp...> __type;
  8049.     };
  8050.   template<typename _Tuple>
  8051.     struct __do_make_tuple
  8052.     : public __make_tuple_impl<0, tuple<>, _Tuple,
  8053.                                std::tuple_size<_Tuple>::value>
  8054.     { };
  8055.   template<typename _Tuple>
  8056.     struct __make_tuple
  8057.     : public __do_make_tuple<typename std::remove_cv
  8058.             <typename std::remove_reference<_Tuple>::type>::type>
  8059.     { };
  8060.   template<typename...>
  8061.     struct __combine_tuples;
  8062.   template<>
  8063.     struct __combine_tuples<>
  8064.     {
  8065.       typedef tuple<> __type;
  8066.     };
  8067.   template<typename... _Ts>
  8068.     struct __combine_tuples<tuple<_Ts...>>
  8069.     {
  8070.       typedef tuple<_Ts...> __type;
  8071.     };
  8072.   template<typename... _T1s, typename... _T2s, typename... _Rem>
  8073.     struct __combine_tuples<tuple<_T1s...>, tuple<_T2s...>, _Rem...>
  8074.     {
  8075.       typedef typename __combine_tuples<tuple<_T1s..., _T2s...>,
  8076.      _Rem...>::__type __type;
  8077.     };
  8078.   template<typename... _Tpls>
  8079.     struct __tuple_cat_result
  8080.     {
  8081.       typedef typename __combine_tuples
  8082.         <typename __make_tuple<_Tpls>::__type...>::__type __type;
  8083.     };
  8084.   template<typename...>
  8085.     struct __make_1st_indices;
  8086.   template<>
  8087.     struct __make_1st_indices<>
  8088.     {
  8089.       typedef std::_Index_tuple<> __type;
  8090.     };
  8091.   template<typename _Tp, typename... _Tpls>
  8092.     struct __make_1st_indices<_Tp, _Tpls...>
  8093.     {
  8094.       typedef typename std::_Build_index_tuple<std::tuple_size<
  8095.  typename std::remove_reference<_Tp>::type>::value>::__type __type;
  8096.     };
  8097.   template<typename _Ret, typename _Indices, typename... _Tpls>
  8098.     struct __tuple_concater;
  8099.   template<typename _Ret, std::size_t... _Is, typename _Tp, typename... _Tpls>
  8100.     struct __tuple_concater<_Ret, std::_Index_tuple<_Is...>, _Tp, _Tpls...>
  8101.     {
  8102.       template<typename... _Us>
  8103.         static constexpr _Ret
  8104.         _S_do(_Tp&& __tp, _Tpls&&... __tps, _Us&&... __us)
  8105.         {
  8106.    typedef typename __make_1st_indices<_Tpls...>::__type __idx;
  8107.    typedef __tuple_concater<_Ret, __idx, _Tpls...> __next;
  8108.    return __next::_S_do(std::forward<_Tpls>(__tps)...,
  8109.           std::forward<_Us>(__us)...,
  8110.           std::get<_Is>(std::forward<_Tp>(__tp))...);
  8111.  }
  8112.     };
  8113.   template<typename _Ret>
  8114.     struct __tuple_concater<_Ret, std::_Index_tuple<>>
  8115.     {
  8116.       template<typename... _Us>
  8117.  static constexpr _Ret
  8118.  _S_do(_Us&&... __us)
  8119.         {
  8120.    return _Ret(std::forward<_Us>(__us)...);
  8121.  }
  8122.     };
  8123.   template<typename... _Tpls, typename = typename
  8124.            enable_if<__and_<__is_tuple_like<_Tpls>...>::value>::type>
  8125.     constexpr auto
  8126.     tuple_cat(_Tpls&&... __tpls)
  8127.     -> typename __tuple_cat_result<_Tpls...>::__type
  8128.     {
  8129.       typedef typename __tuple_cat_result<_Tpls...>::__type __ret;
  8130.       typedef typename __make_1st_indices<_Tpls...>::__type __idx;
  8131.       typedef __tuple_concater<__ret, __idx, _Tpls...> __concater;
  8132.       return __concater::_S_do(std::forward<_Tpls>(__tpls)...);
  8133.     }
  8134.   template<typename... _Elements>
  8135.     inline tuple<_Elements&...>
  8136.     tie(_Elements&... __args) noexcept
  8137.     { return tuple<_Elements&...>(__args...); }
  8138.   template<typename... _Elements>
  8139.     inline void
  8140.     swap(tuple<_Elements...>& __x, tuple<_Elements...>& __y)
  8141.     noexcept(noexcept(__x.swap(__y)))
  8142.     { __x.swap(__y); }
  8143.   struct _Swallow_assign
  8144.   {
  8145.     template<class _Tp>
  8146.       const _Swallow_assign&
  8147.       operator=(const _Tp&) const
  8148.       { return *this; }
  8149.   };
  8150.   const _Swallow_assign ignore{};
  8151.   template<typename... _Types, typename _Alloc>
  8152.     struct uses_allocator<tuple<_Types...>, _Alloc> : true_type { };
  8153.   template<class _T1, class _T2>
  8154.     template<typename... _Args1, typename... _Args2>
  8155.       inline
  8156.       pair<_T1, _T2>::
  8157.       pair(piecewise_construct_t,
  8158.     tuple<_Args1...> __first, tuple<_Args2...> __second)
  8159.       : pair(__first, __second,
  8160.       typename _Build_index_tuple<sizeof...(_Args1)>::__type(),
  8161.       typename _Build_index_tuple<sizeof...(_Args2)>::__type())
  8162.       { }
  8163.   template<class _T1, class _T2>
  8164.     template<typename... _Args1, std::size_t... _Indexes1,
  8165.              typename... _Args2, std::size_t... _Indexes2>
  8166.       inline
  8167.       pair<_T1, _T2>::
  8168.       pair(tuple<_Args1...>& __tuple1, tuple<_Args2...>& __tuple2,
  8169.     _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>)
  8170.       : first(std::forward<_Args1>(std::get<_Indexes1>(__tuple1))...),
  8171.         second(std::forward<_Args2>(std::get<_Indexes2>(__tuple2))...)
  8172.       { }
  8173.  
  8174. }
  8175.        
  8176. namespace std __attribute__ ((__visibility__ ("default")))
  8177. {
  8178.  
  8179.   template<typename _Result, typename _Arg>
  8180.     struct __hash_base
  8181.     {
  8182.       typedef _Result result_type;
  8183.       typedef _Arg argument_type;
  8184.     };
  8185.   template<typename _Tp>
  8186.     struct hash : public __hash_base<size_t, _Tp>
  8187.     {
  8188.       static_assert(sizeof(_Tp) < 0,
  8189.       "std::hash is not specialized for this type");
  8190.       size_t operator()(const _Tp&) const noexcept;
  8191.     };
  8192.   template<typename _Tp>
  8193.     struct hash<_Tp*> : public __hash_base<size_t, _Tp*>
  8194.     {
  8195.       size_t
  8196.       operator()(_Tp* __p) const noexcept
  8197.       { return reinterpret_cast<size_t>(__p); }
  8198.     };
  8199.   template<> struct hash<bool> : public __hash_base<size_t, bool> { size_t operator()(bool __val) const noexcept { return static_cast<size_t>(__val); } };
  8200.   template<> struct hash<char> : public __hash_base<size_t, char> { size_t operator()(char __val) const noexcept { return static_cast<size_t>(__val); } };
  8201.   template<> struct hash<signed char> : public __hash_base<size_t, signed char> { size_t operator()(signed char __val) const noexcept { return static_cast<size_t>(__val); } };
  8202.   template<> struct hash<unsigned char> : public __hash_base<size_t, unsigned char> { size_t operator()(unsigned char __val) const noexcept { return static_cast<size_t>(__val); } };
  8203.   template<> struct hash<wchar_t> : public __hash_base<size_t, wchar_t> { size_t operator()(wchar_t __val) const noexcept { return static_cast<size_t>(__val); } };
  8204.   template<> struct hash<char16_t> : public __hash_base<size_t, char16_t> { size_t operator()(char16_t __val) const noexcept { return static_cast<size_t>(__val); } };
  8205.   template<> struct hash<char32_t> : public __hash_base<size_t, char32_t> { size_t operator()(char32_t __val) const noexcept { return static_cast<size_t>(__val); } };
  8206.   template<> struct hash<short> : public __hash_base<size_t, short> { size_t operator()(short __val) const noexcept { return static_cast<size_t>(__val); } };
  8207.   template<> struct hash<int> : public __hash_base<size_t, int> { size_t operator()(int __val) const noexcept { return static_cast<size_t>(__val); } };
  8208.   template<> struct hash<long> : public __hash_base<size_t, long> { size_t operator()(long __val) const noexcept { return static_cast<size_t>(__val); } };
  8209.   template<> struct hash<long long> : public __hash_base<size_t, long long> { size_t operator()(long long __val) const noexcept { return static_cast<size_t>(__val); } };
  8210.   template<> struct hash<unsigned short> : public __hash_base<size_t, unsigned short> { size_t operator()(unsigned short __val) const noexcept { return static_cast<size_t>(__val); } };
  8211.   template<> struct hash<unsigned int> : public __hash_base<size_t, unsigned int> { size_t operator()(unsigned int __val) const noexcept { return static_cast<size_t>(__val); } };
  8212.   template<> struct hash<unsigned long> : public __hash_base<size_t, unsigned long> { size_t operator()(unsigned long __val) const noexcept { return static_cast<size_t>(__val); } };
  8213.   template<> struct hash<unsigned long long> : public __hash_base<size_t, unsigned long long> { size_t operator()(unsigned long long __val) const noexcept { return static_cast<size_t>(__val); } };
  8214.   struct _Hash_impl
  8215.   {
  8216.     static size_t
  8217.     hash(const void* __ptr, size_t __clength,
  8218.   size_t __seed = static_cast<size_t>(0xc70f6907UL))
  8219.     { return _Hash_bytes(__ptr, __clength, __seed); }
  8220.     template<typename _Tp>
  8221.       static size_t
  8222.       hash(const _Tp& __val)
  8223.       { return hash(&__val, sizeof(__val)); }
  8224.     template<typename _Tp>
  8225.       static size_t
  8226.       __hash_combine(const _Tp& __val, size_t __hash)
  8227.       { return hash(&__val, sizeof(__val), __hash); }
  8228.   };
  8229.   struct _Fnv_hash_impl
  8230.   {
  8231.     static size_t
  8232.     hash(const void* __ptr, size_t __clength,
  8233.   size_t __seed = static_cast<size_t>(2166136261UL))
  8234.     { return _Fnv_hash_bytes(__ptr, __clength, __seed); }
  8235.     template<typename _Tp>
  8236.       static size_t
  8237.       hash(const _Tp& __val)
  8238.       { return hash(&__val, sizeof(__val)); }
  8239.     template<typename _Tp>
  8240.       static size_t
  8241.       __hash_combine(const _Tp& __val, size_t __hash)
  8242.       { return hash(&__val, sizeof(__val), __hash); }
  8243.   };
  8244.   template<>
  8245.     struct hash<float> : public __hash_base<size_t, float>
  8246.     {
  8247.       size_t
  8248.       operator()(float __val) const noexcept
  8249.       {
  8250.  return __val != 0.0f ? std::_Hash_impl::hash(__val) : 0;
  8251.       }
  8252.     };
  8253.   template<>
  8254.     struct hash<double> : public __hash_base<size_t, double>
  8255.     {
  8256.       size_t
  8257.       operator()(double __val) const noexcept
  8258.       {
  8259.  return __val != 0.0 ? std::_Hash_impl::hash(__val) : 0;
  8260.       }
  8261.     };
  8262.   template<>
  8263.     struct hash<long double>
  8264.     : public __hash_base<size_t, long double>
  8265.     {
  8266.       __attribute__ ((__pure__)) size_t
  8267.       operator()(long double __val) const noexcept;
  8268.     };
  8269.  
  8270. }
  8271. namespace std __attribute__ ((__visibility__ ("default")))
  8272. {
  8273.  
  8274.   template<typename _MemberPointer>
  8275.     class _Mem_fn;
  8276.   template<typename _Tp, typename _Class>
  8277.     _Mem_fn<_Tp _Class::*>
  8278.     mem_fn(_Tp _Class::*);
  8279. template<typename _Tp> class __has_result_type_helper : __sfinae_types { template<typename _Up> struct _Wrap_type { }; template<typename _Up> static __one __test(_Wrap_type<typename _Up::result_type>*); template<typename _Up> static __two __test(...); public: static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; }; template<typename _Tp> struct __has_result_type : integral_constant<bool, __has_result_type_helper <typename remove_cv<_Tp>::type>::value> { };
  8280.   template<bool _Has_result_type, typename _Functor>
  8281.     struct _Maybe_get_result_type
  8282.     { };
  8283.   template<typename _Functor>
  8284.     struct _Maybe_get_result_type<true, _Functor>
  8285.     { typedef typename _Functor::result_type result_type; };
  8286.   template<typename _Functor>
  8287.     struct _Weak_result_type_impl
  8288.     : _Maybe_get_result_type<__has_result_type<_Functor>::value, _Functor>
  8289.     { };
  8290.   template<typename _Res, typename... _ArgTypes>
  8291.     struct _Weak_result_type_impl<_Res(_ArgTypes...)>
  8292.     { typedef _Res result_type; };
  8293.   template<typename _Res, typename... _ArgTypes>
  8294.     struct _Weak_result_type_impl<_Res(_ArgTypes......)>
  8295.     { typedef _Res result_type; };
  8296.   template<typename _Res, typename... _ArgTypes>
  8297.     struct _Weak_result_type_impl<_Res(_ArgTypes...) const>
  8298.     { typedef _Res result_type; };
  8299.   template<typename _Res, typename... _ArgTypes>
  8300.     struct _Weak_result_type_impl<_Res(_ArgTypes......) const>
  8301.     { typedef _Res result_type; };
  8302.   template<typename _Res, typename... _ArgTypes>
  8303.     struct _Weak_result_type_impl<_Res(_ArgTypes...) volatile>
  8304.     { typedef _Res result_type; };
  8305.   template<typename _Res, typename... _ArgTypes>
  8306.     struct _Weak_result_type_impl<_Res(_ArgTypes......) volatile>
  8307.     { typedef _Res result_type; };
  8308.   template<typename _Res, typename... _ArgTypes>
  8309.     struct _Weak_result_type_impl<_Res(_ArgTypes...) const volatile>
  8310.     { typedef _Res result_type; };
  8311.   template<typename _Res, typename... _ArgTypes>
  8312.     struct _Weak_result_type_impl<_Res(_ArgTypes......) const volatile>
  8313.     { typedef _Res result_type; };
  8314.   template<typename _Res, typename... _ArgTypes>
  8315.     struct _Weak_result_type_impl<_Res(&)(_ArgTypes...)>
  8316.     { typedef _Res result_type; };
  8317.   template<typename _Res, typename... _ArgTypes>
  8318.     struct _Weak_result_type_impl<_Res(&)(_ArgTypes......)>
  8319.     { typedef _Res result_type; };
  8320.   template<typename _Res, typename... _ArgTypes>
  8321.     struct _Weak_result_type_impl<_Res(*)(_ArgTypes...)>
  8322.     { typedef _Res result_type; };
  8323.   template<typename _Res, typename... _ArgTypes>
  8324.     struct _Weak_result_type_impl<_Res(*)(_ArgTypes......)>
  8325.     { typedef _Res result_type; };
  8326.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8327.     struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)>
  8328.     { typedef _Res result_type; };
  8329.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8330.     struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......)>
  8331.     { typedef _Res result_type; };
  8332.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8333.     struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) const>
  8334.     { typedef _Res result_type; };
  8335.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8336.     struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......) const>
  8337.     { typedef _Res result_type; };
  8338.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8339.     struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...) volatile>
  8340.     { typedef _Res result_type; };
  8341.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8342.     struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......) volatile>
  8343.     { typedef _Res result_type; };
  8344.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8345.     struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes...)
  8346.       const volatile>
  8347.     { typedef _Res result_type; };
  8348.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8349.     struct _Weak_result_type_impl<_Res (_Class::*)(_ArgTypes......)
  8350.       const volatile>
  8351.     { typedef _Res result_type; };
  8352.   template<typename _Functor>
  8353.     struct _Weak_result_type
  8354.     : _Weak_result_type_impl<typename remove_cv<_Functor>::type>
  8355.     { };
  8356.   template<typename _Tp>
  8357.     struct _Derives_from_unary_function : __sfinae_types
  8358.     {
  8359.     private:
  8360.       template<typename _T1, typename _Res>
  8361.  static __one __test(const volatile unary_function<_T1, _Res>*);
  8362.       static __two __test(...);
  8363.     public:
  8364.       static const bool value = sizeof(__test((_Tp*)0)) == 1;
  8365.     };
  8366.   template<typename _Tp>
  8367.     struct _Derives_from_binary_function : __sfinae_types
  8368.     {
  8369.     private:
  8370.       template<typename _T1, typename _T2, typename _Res>
  8371.  static __one __test(const volatile binary_function<_T1, _T2, _Res>*);
  8372.       static __two __test(...);
  8373.     public:
  8374.       static const bool value = sizeof(__test((_Tp*)0)) == 1;
  8375.     };
  8376.   template<typename _Functor, typename... _Args>
  8377.     inline
  8378.     typename enable_if<
  8379.       (!is_member_pointer<_Functor>::value
  8380.        && !is_function<_Functor>::value
  8381.        && !is_function<typename remove_pointer<_Functor>::type>::value),
  8382.       typename result_of<_Functor(_Args&&...)>::type
  8383.     >::type
  8384.     __invoke(_Functor& __f, _Args&&... __args)
  8385.     {
  8386.       return __f(std::forward<_Args>(__args)...);
  8387.     }
  8388.   template<typename _Functor, typename... _Args>
  8389.     inline
  8390.     typename enable_if<
  8391.              (is_member_pointer<_Functor>::value
  8392.               && !is_function<_Functor>::value
  8393.               && !is_function<typename remove_pointer<_Functor>::type>::value),
  8394.              typename result_of<_Functor(_Args&&...)>::type
  8395.            >::type
  8396.     __invoke(_Functor& __f, _Args&&... __args)
  8397.     {
  8398.       return mem_fn(__f)(std::forward<_Args>(__args)...);
  8399.     }
  8400.   template<typename _Functor, typename... _Args>
  8401.     inline
  8402.     typename enable_if<
  8403.       (is_pointer<_Functor>::value
  8404.        && is_function<typename remove_pointer<_Functor>::type>::value),
  8405.       typename result_of<_Functor(_Args&&...)>::type
  8406.     >::type
  8407.     __invoke(_Functor __f, _Args&&... __args)
  8408.     {
  8409.       return __f(std::forward<_Args>(__args)...);
  8410.     }
  8411.   template<bool _Unary, bool _Binary, typename _Tp>
  8412.     struct _Reference_wrapper_base_impl;
  8413.   template<typename _Tp>
  8414.     struct _Reference_wrapper_base_impl<false, false, _Tp>
  8415.     : _Weak_result_type<_Tp>
  8416.     { };
  8417.   template<typename _Tp>
  8418.     struct _Reference_wrapper_base_impl<true, false, _Tp>
  8419.     : _Weak_result_type<_Tp>
  8420.     {
  8421.       typedef typename _Tp::argument_type argument_type;
  8422.     };
  8423.   template<typename _Tp>
  8424.     struct _Reference_wrapper_base_impl<false, true, _Tp>
  8425.     : _Weak_result_type<_Tp>
  8426.     {
  8427.       typedef typename _Tp::first_argument_type first_argument_type;
  8428.       typedef typename _Tp::second_argument_type second_argument_type;
  8429.     };
  8430.    template<typename _Tp>
  8431.     struct _Reference_wrapper_base_impl<true, true, _Tp>
  8432.     : _Weak_result_type<_Tp>
  8433.     {
  8434.       typedef typename _Tp::argument_type argument_type;
  8435.       typedef typename _Tp::first_argument_type first_argument_type;
  8436.       typedef typename _Tp::second_argument_type second_argument_type;
  8437.     };
  8438.   template<typename _Tp> class __has_argument_type_helper : __sfinae_types { template<typename _Up> struct _Wrap_type { }; template<typename _Up> static __one __test(_Wrap_type<typename _Up::argument_type>*); template<typename _Up> static __two __test(...); public: static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; }; template<typename _Tp> struct __has_argument_type : integral_constant<bool, __has_argument_type_helper <typename remove_cv<_Tp>::type>::value> { };
  8439.   template<typename _Tp> class __has_first_argument_type_helper : __sfinae_types { template<typename _Up> struct _Wrap_type { }; template<typename _Up> static __one __test(_Wrap_type<typename _Up::first_argument_type>*); template<typename _Up> static __two __test(...); public: static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; }; template<typename _Tp> struct __has_first_argument_type : integral_constant<bool, __has_first_argument_type_helper <typename remove_cv<_Tp>::type>::value> { };
  8440.   template<typename _Tp> class __has_second_argument_type_helper : __sfinae_types { template<typename _Up> struct _Wrap_type { }; template<typename _Up> static __one __test(_Wrap_type<typename _Up::second_argument_type>*); template<typename _Up> static __two __test(...); public: static constexpr bool value = sizeof(__test<_Tp>(0)) == 1; }; template<typename _Tp> struct __has_second_argument_type : integral_constant<bool, __has_second_argument_type_helper <typename remove_cv<_Tp>::type>::value> { };
  8441.   template<typename _Tp>
  8442.     struct _Reference_wrapper_base
  8443.     : _Reference_wrapper_base_impl<
  8444.       __has_argument_type<_Tp>::value,
  8445.       __has_first_argument_type<_Tp>::value
  8446.       && __has_second_argument_type<_Tp>::value,
  8447.       _Tp>
  8448.     { };
  8449.   template<typename _Res, typename _T1>
  8450.     struct _Reference_wrapper_base<_Res(_T1)>
  8451.     : unary_function<_T1, _Res>
  8452.     { };
  8453.   template<typename _Res, typename _T1>
  8454.     struct _Reference_wrapper_base<_Res(_T1) const>
  8455.     : unary_function<_T1, _Res>
  8456.     { };
  8457.   template<typename _Res, typename _T1>
  8458.     struct _Reference_wrapper_base<_Res(_T1) volatile>
  8459.     : unary_function<_T1, _Res>
  8460.     { };
  8461.   template<typename _Res, typename _T1>
  8462.     struct _Reference_wrapper_base<_Res(_T1) const volatile>
  8463.     : unary_function<_T1, _Res>
  8464.     { };
  8465.   template<typename _Res, typename _T1, typename _T2>
  8466.     struct _Reference_wrapper_base<_Res(_T1, _T2)>
  8467.     : binary_function<_T1, _T2, _Res>
  8468.     { };
  8469.   template<typename _Res, typename _T1, typename _T2>
  8470.     struct _Reference_wrapper_base<_Res(_T1, _T2) const>
  8471.     : binary_function<_T1, _T2, _Res>
  8472.     { };
  8473.   template<typename _Res, typename _T1, typename _T2>
  8474.     struct _Reference_wrapper_base<_Res(_T1, _T2) volatile>
  8475.     : binary_function<_T1, _T2, _Res>
  8476.     { };
  8477.   template<typename _Res, typename _T1, typename _T2>
  8478.     struct _Reference_wrapper_base<_Res(_T1, _T2) const volatile>
  8479.     : binary_function<_T1, _T2, _Res>
  8480.     { };
  8481.   template<typename _Res, typename _T1>
  8482.     struct _Reference_wrapper_base<_Res(*)(_T1)>
  8483.     : unary_function<_T1, _Res>
  8484.     { };
  8485.   template<typename _Res, typename _T1, typename _T2>
  8486.     struct _Reference_wrapper_base<_Res(*)(_T1, _T2)>
  8487.     : binary_function<_T1, _T2, _Res>
  8488.     { };
  8489.   template<typename _Res, typename _T1>
  8490.     struct _Reference_wrapper_base<_Res (_T1::*)()>
  8491.     : unary_function<_T1*, _Res>
  8492.     { };
  8493.   template<typename _Res, typename _T1, typename _T2>
  8494.     struct _Reference_wrapper_base<_Res (_T1::*)(_T2)>
  8495.     : binary_function<_T1*, _T2, _Res>
  8496.     { };
  8497.   template<typename _Res, typename _T1>
  8498.     struct _Reference_wrapper_base<_Res (_T1::*)() const>
  8499.     : unary_function<const _T1*, _Res>
  8500.     { };
  8501.   template<typename _Res, typename _T1, typename _T2>
  8502.     struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const>
  8503.     : binary_function<const _T1*, _T2, _Res>
  8504.     { };
  8505.   template<typename _Res, typename _T1>
  8506.     struct _Reference_wrapper_base<_Res (_T1::*)() volatile>
  8507.     : unary_function<volatile _T1*, _Res>
  8508.     { };
  8509.   template<typename _Res, typename _T1, typename _T2>
  8510.     struct _Reference_wrapper_base<_Res (_T1::*)(_T2) volatile>
  8511.     : binary_function<volatile _T1*, _T2, _Res>
  8512.     { };
  8513.   template<typename _Res, typename _T1>
  8514.     struct _Reference_wrapper_base<_Res (_T1::*)() const volatile>
  8515.     : unary_function<const volatile _T1*, _Res>
  8516.     { };
  8517.   template<typename _Res, typename _T1, typename _T2>
  8518.     struct _Reference_wrapper_base<_Res (_T1::*)(_T2) const volatile>
  8519.     : binary_function<const volatile _T1*, _T2, _Res>
  8520.     { };
  8521.   template<typename _Tp>
  8522.     class reference_wrapper
  8523.     : public _Reference_wrapper_base<typename remove_cv<_Tp>::type>
  8524.     {
  8525.       _Tp* _M_data;
  8526.     public:
  8527.       typedef _Tp type;
  8528.       reference_wrapper(_Tp& __indata) noexcept
  8529.       : _M_data(std::__addressof(__indata))
  8530.       { }
  8531.       reference_wrapper(_Tp&&) = delete;
  8532.       reference_wrapper(const reference_wrapper<_Tp>& __inref) noexcept
  8533.       : _M_data(__inref._M_data)
  8534.       { }
  8535.       reference_wrapper&
  8536.       operator=(const reference_wrapper<_Tp>& __inref) noexcept
  8537.       {
  8538.  _M_data = __inref._M_data;
  8539.  return *this;
  8540.       }
  8541.       operator _Tp&() const noexcept
  8542.       { return this->get(); }
  8543.       _Tp&
  8544.       get() const noexcept
  8545.       { return *_M_data; }
  8546.       template<typename... _Args>
  8547.  typename result_of<_Tp&(_Args&&...)>::type
  8548.  operator()(_Args&&... __args) const
  8549.  {
  8550.    return __invoke(get(), std::forward<_Args>(__args)...);
  8551.  }
  8552.     };
  8553.   template<typename _Tp>
  8554.     inline reference_wrapper<_Tp>
  8555.     ref(_Tp& __t) noexcept
  8556.     { return reference_wrapper<_Tp>(__t); }
  8557.   template<typename _Tp>
  8558.     inline reference_wrapper<const _Tp>
  8559.     cref(const _Tp& __t) noexcept
  8560.     { return reference_wrapper<const _Tp>(__t); }
  8561.   template<typename _Tp>
  8562.     void ref(const _Tp&&) = delete;
  8563.   template<typename _Tp>
  8564.     void cref(const _Tp&&) = delete;
  8565.   template<typename _Tp>
  8566.     inline reference_wrapper<_Tp>
  8567.     ref(reference_wrapper<_Tp> __t) noexcept
  8568.     { return ref(__t.get()); }
  8569.   template<typename _Tp>
  8570.     inline reference_wrapper<const _Tp>
  8571.     cref(reference_wrapper<_Tp> __t) noexcept
  8572.     { return cref(__t.get()); }
  8573.   template<typename _Res, typename... _ArgTypes>
  8574.     struct _Maybe_unary_or_binary_function { };
  8575.   template<typename _Res, typename _T1>
  8576.     struct _Maybe_unary_or_binary_function<_Res, _T1>
  8577.     : std::unary_function<_T1, _Res> { };
  8578.   template<typename _Res, typename _T1, typename _T2>
  8579.     struct _Maybe_unary_or_binary_function<_Res, _T1, _T2>
  8580.     : std::binary_function<_T1, _T2, _Res> { };
  8581.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8582.     class _Mem_fn<_Res (_Class::*)(_ArgTypes...)>
  8583.     : public _Maybe_unary_or_binary_function<_Res, _Class*, _ArgTypes...>
  8584.     {
  8585.       typedef _Res (_Class::*_Functor)(_ArgTypes...);
  8586.       template<typename _Tp>
  8587.  _Res
  8588.  _M_call(_Tp& __object, const volatile _Class *,
  8589.   _ArgTypes... __args) const
  8590.  { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8591.       template<typename _Tp>
  8592.  _Res
  8593.  _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
  8594.  { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8595.     public:
  8596.       typedef _Res result_type;
  8597.       explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
  8598.       _Res
  8599.       operator()(_Class& __object, _ArgTypes... __args) const
  8600.       { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8601.       _Res
  8602.       operator()(_Class* __object, _ArgTypes... __args) const
  8603.       { return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8604.       template<typename _Tp>
  8605.  _Res
  8606.  operator()(_Tp& __object, _ArgTypes... __args) const
  8607.  {
  8608.    return _M_call(__object, &__object,
  8609.        std::forward<_ArgTypes>(__args)...);
  8610.  }
  8611.     private:
  8612.       _Functor __pmf;
  8613.     };
  8614.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8615.     class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const>
  8616.     : public _Maybe_unary_or_binary_function<_Res, const _Class*,
  8617.           _ArgTypes...>
  8618.     {
  8619.       typedef _Res (_Class::*_Functor)(_ArgTypes...) const;
  8620.       template<typename _Tp>
  8621.  _Res
  8622.  _M_call(_Tp& __object, const volatile _Class *,
  8623.   _ArgTypes... __args) const
  8624.  { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8625.       template<typename _Tp>
  8626.  _Res
  8627.  _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
  8628.  { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8629.     public:
  8630.       typedef _Res result_type;
  8631.       explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
  8632.       _Res
  8633.       operator()(const _Class& __object, _ArgTypes... __args) const
  8634.       { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8635.       _Res
  8636.       operator()(const _Class* __object, _ArgTypes... __args) const
  8637.       { return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8638.       template<typename _Tp>
  8639.  _Res operator()(_Tp& __object, _ArgTypes... __args) const
  8640.  {
  8641.    return _M_call(__object, &__object,
  8642.        std::forward<_ArgTypes>(__args)...);
  8643.  }
  8644.     private:
  8645.       _Functor __pmf;
  8646.     };
  8647.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8648.     class _Mem_fn<_Res (_Class::*)(_ArgTypes...) volatile>
  8649.     : public _Maybe_unary_or_binary_function<_Res, volatile _Class*,
  8650.           _ArgTypes...>
  8651.     {
  8652.       typedef _Res (_Class::*_Functor)(_ArgTypes...) volatile;
  8653.       template<typename _Tp>
  8654.  _Res
  8655.  _M_call(_Tp& __object, const volatile _Class *,
  8656.   _ArgTypes... __args) const
  8657.  { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8658.       template<typename _Tp>
  8659.  _Res
  8660.  _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
  8661.  { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8662.     public:
  8663.       typedef _Res result_type;
  8664.       explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
  8665.       _Res
  8666.       operator()(volatile _Class& __object, _ArgTypes... __args) const
  8667.       { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8668.       _Res
  8669.       operator()(volatile _Class* __object, _ArgTypes... __args) const
  8670.       { return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8671.       template<typename _Tp>
  8672.  _Res
  8673.  operator()(_Tp& __object, _ArgTypes... __args) const
  8674.  {
  8675.    return _M_call(__object, &__object,
  8676.        std::forward<_ArgTypes>(__args)...);
  8677.  }
  8678.     private:
  8679.       _Functor __pmf;
  8680.     };
  8681.   template<typename _Res, typename _Class, typename... _ArgTypes>
  8682.     class _Mem_fn<_Res (_Class::*)(_ArgTypes...) const volatile>
  8683.     : public _Maybe_unary_or_binary_function<_Res, const volatile _Class*,
  8684.           _ArgTypes...>
  8685.     {
  8686.       typedef _Res (_Class::*_Functor)(_ArgTypes...) const volatile;
  8687.       template<typename _Tp>
  8688.  _Res
  8689.  _M_call(_Tp& __object, const volatile _Class *,
  8690.   _ArgTypes... __args) const
  8691.  { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8692.       template<typename _Tp>
  8693.  _Res
  8694.  _M_call(_Tp& __ptr, const volatile void *, _ArgTypes... __args) const
  8695.  { return ((*__ptr).*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8696.     public:
  8697.       typedef _Res result_type;
  8698.       explicit _Mem_fn(_Functor __pmf) : __pmf(__pmf) { }
  8699.       _Res
  8700.       operator()(const volatile _Class& __object, _ArgTypes... __args) const
  8701.       { return (__object.*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8702.       _Res
  8703.       operator()(const volatile _Class* __object, _ArgTypes... __args) const
  8704.       { return (__object->*__pmf)(std::forward<_ArgTypes>(__args)...); }
  8705.       template<typename _Tp>
  8706.  _Res operator()(_Tp& __object, _ArgTypes... __args) const
  8707.  {
  8708.    return _M_call(__object, &__object,
  8709.        std::forward<_ArgTypes>(__args)...);
  8710.  }
  8711.     private:
  8712.       _Functor __pmf;
  8713.     };
  8714.   template<typename _Tp, bool>
  8715.     struct _Mem_fn_const_or_non
  8716.     {
  8717.       typedef const _Tp& type;
  8718.     };
  8719.   template<typename _Tp>
  8720.     struct _Mem_fn_const_or_non<_Tp, false>
  8721.     {
  8722.       typedef _Tp& type;
  8723.     };
  8724.   template<typename _Res, typename _Class>
  8725.     class _Mem_fn<_Res _Class::*>
  8726.     {
  8727.       template<typename _Tp>
  8728.  _Res&
  8729.  _M_call(_Tp& __object, _Class *) const
  8730.  { return __object.*__pm; }
  8731.       template<typename _Tp, typename _Up>
  8732.  _Res&
  8733.  _M_call(_Tp& __object, _Up * const *) const
  8734.  { return (*__object).*__pm; }
  8735.       template<typename _Tp, typename _Up>
  8736.  const _Res&
  8737.  _M_call(_Tp& __object, const _Up * const *) const
  8738.  { return (*__object).*__pm; }
  8739.       template<typename _Tp>
  8740.  const _Res&
  8741.  _M_call(_Tp& __object, const _Class *) const
  8742.  { return __object.*__pm; }
  8743.       template<typename _Tp>
  8744.  const _Res&
  8745.  _M_call(_Tp& __ptr, const volatile void*) const
  8746.  { return (*__ptr).*__pm; }
  8747.       template<typename _Tp> static _Tp& __get_ref();
  8748.       template<typename _Tp>
  8749.  static __sfinae_types::__one __check_const(_Tp&, _Class*);
  8750.       template<typename _Tp, typename _Up>
  8751.  static __sfinae_types::__one __check_const(_Tp&, _Up * const *);
  8752.       template<typename _Tp, typename _Up>
  8753.  static __sfinae_types::__two __check_const(_Tp&, const _Up * const *);
  8754.       template<typename _Tp>
  8755.  static __sfinae_types::__two __check_const(_Tp&, const _Class*);
  8756.       template<typename _Tp>
  8757.  static __sfinae_types::__two __check_const(_Tp&, const volatile void*);
  8758.     public:
  8759.       template<typename _Tp>
  8760.  struct _Result_type
  8761.  : _Mem_fn_const_or_non<_Res,
  8762.    (sizeof(__sfinae_types::__two)
  8763.     == sizeof(__check_const<_Tp>(__get_ref<_Tp>(), (_Tp*)0)))>
  8764.  { };
  8765.       template<typename _Signature>
  8766.  struct result;
  8767.       template<typename _CVMem, typename _Tp>
  8768.  struct result<_CVMem(_Tp)>
  8769.  : public _Result_type<_Tp> { };
  8770.       template<typename _CVMem, typename _Tp>
  8771.  struct result<_CVMem(_Tp&)>
  8772.  : public _Result_type<_Tp> { };
  8773.       explicit
  8774.       _Mem_fn(_Res _Class::*__pm) : __pm(__pm) { }
  8775.       _Res&
  8776.       operator()(_Class& __object) const
  8777.       { return __object.*__pm; }
  8778.       const _Res&
  8779.       operator()(const _Class& __object) const
  8780.       { return __object.*__pm; }
  8781.       _Res&
  8782.       operator()(_Class* __object) const
  8783.       { return __object->*__pm; }
  8784.       const _Res&
  8785.       operator()(const _Class* __object) const
  8786.       { return __object->*__pm; }
  8787.       template<typename _Tp>
  8788.  typename _Result_type<_Tp>::type
  8789.  operator()(_Tp& __unknown) const
  8790.  { return _M_call(__unknown, &__unknown); }
  8791.     private:
  8792.       _Res _Class::*__pm;
  8793.     };
  8794.   template<typename _Tp, typename _Class>
  8795.     inline _Mem_fn<_Tp _Class::*>
  8796.     mem_fn(_Tp _Class::* __pm)
  8797.     {
  8798.       return _Mem_fn<_Tp _Class::*>(__pm);
  8799.     }
  8800.   template<typename _Tp>
  8801.     struct is_bind_expression
  8802.     : public false_type { };
  8803.   template<typename _Tp>
  8804.     struct is_placeholder
  8805.     : public integral_constant<int, 0>
  8806.     { };
  8807.   template<int _Num> struct _Placeholder { };
  8808.  
  8809.   namespace placeholders
  8810.   {
  8811.  
  8812.     extern const _Placeholder<1> _1;
  8813.     extern const _Placeholder<2> _2;
  8814.     extern const _Placeholder<3> _3;
  8815.     extern const _Placeholder<4> _4;
  8816.     extern const _Placeholder<5> _5;
  8817.     extern const _Placeholder<6> _6;
  8818.     extern const _Placeholder<7> _7;
  8819.     extern const _Placeholder<8> _8;
  8820.     extern const _Placeholder<9> _9;
  8821.     extern const _Placeholder<10> _10;
  8822.     extern const _Placeholder<11> _11;
  8823.     extern const _Placeholder<12> _12;
  8824.     extern const _Placeholder<13> _13;
  8825.     extern const _Placeholder<14> _14;
  8826.     extern const _Placeholder<15> _15;
  8827.     extern const _Placeholder<16> _16;
  8828.     extern const _Placeholder<17> _17;
  8829.     extern const _Placeholder<18> _18;
  8830.     extern const _Placeholder<19> _19;
  8831.     extern const _Placeholder<20> _20;
  8832.     extern const _Placeholder<21> _21;
  8833.     extern const _Placeholder<22> _22;
  8834.     extern const _Placeholder<23> _23;
  8835.     extern const _Placeholder<24> _24;
  8836.     extern const _Placeholder<25> _25;
  8837.     extern const _Placeholder<26> _26;
  8838.     extern const _Placeholder<27> _27;
  8839.     extern const _Placeholder<28> _28;
  8840.     extern const _Placeholder<29> _29;
  8841.  
  8842.   }
  8843.  
  8844.   template<int _Num>
  8845.     struct is_placeholder<_Placeholder<_Num> >
  8846.     : public integral_constant<int, _Num>
  8847.     { };
  8848.   template<int _Num>
  8849.     struct is_placeholder<const _Placeholder<_Num> >
  8850.     : public integral_constant<int, _Num>
  8851.     { };
  8852.   struct _No_tuple_element;
  8853.   template<std::size_t __i, typename _Tuple, bool _IsSafe>
  8854.     struct _Safe_tuple_element_impl
  8855.     : tuple_element<__i, _Tuple> { };
  8856.   template<std::size_t __i, typename _Tuple>
  8857.     struct _Safe_tuple_element_impl<__i, _Tuple, false>
  8858.     {
  8859.       typedef _No_tuple_element type;
  8860.     };
  8861.  template<std::size_t __i, typename _Tuple>
  8862.    struct _Safe_tuple_element
  8863.    : _Safe_tuple_element_impl<__i, _Tuple,
  8864.          (__i < tuple_size<_Tuple>::value)>
  8865.    { };
  8866.   template<typename _Arg,
  8867.     bool _IsBindExp = is_bind_expression<_Arg>::value,
  8868.     bool _IsPlaceholder = (is_placeholder<_Arg>::value > 0)>
  8869.     class _Mu;
  8870.   template<typename _Tp>
  8871.     class _Mu<reference_wrapper<_Tp>, false, false>
  8872.     {
  8873.     public:
  8874.       typedef _Tp& result_type;
  8875.       template<typename _CVRef, typename _Tuple>
  8876.  result_type
  8877.  operator()(_CVRef& __arg, _Tuple&) const volatile
  8878.  { return __arg.get(); }
  8879.     };
  8880.   template<typename _Arg>
  8881.     class _Mu<_Arg, true, false>
  8882.     {
  8883.     public:
  8884.       template<typename _CVArg, typename... _Args>
  8885.  auto
  8886.  operator()(_CVArg& __arg,
  8887.      tuple<_Args...>& __tuple) const volatile
  8888.  -> decltype(__arg(declval<_Args>()...))
  8889.  {
  8890.    typedef typename _Build_index_tuple<sizeof...(_Args)>::__type
  8891.      _Indexes;
  8892.    return this->__call(__arg, __tuple, _Indexes());
  8893.  }
  8894.     private:
  8895.       template<typename _CVArg, typename... _Args, std::size_t... _Indexes>
  8896.  auto
  8897.  __call(_CVArg& __arg, tuple<_Args...>& __tuple,
  8898.         const _Index_tuple<_Indexes...>&) const volatile
  8899.  -> decltype(__arg(declval<_Args>()...))
  8900.  {
  8901.    return __arg(std::forward<_Args>(get<_Indexes>(__tuple))...);
  8902.  }
  8903.     };
  8904.   template<typename _Arg>
  8905.     class _Mu<_Arg, false, true>
  8906.     {
  8907.     public:
  8908.       template<typename _Signature> class result;
  8909.       template<typename _CVMu, typename _CVArg, typename _Tuple>
  8910.  class result<_CVMu(_CVArg, _Tuple)>
  8911.  {
  8912.    typedef typename _Safe_tuple_element<(is_placeholder<_Arg>::value
  8913.       - 1), _Tuple>::type
  8914.      __base_type;
  8915.  public:
  8916.    typedef typename add_rvalue_reference<__base_type>::type type;
  8917.  };
  8918.       template<typename _Tuple>
  8919.  typename result<_Mu(_Arg, _Tuple)>::type
  8920.  operator()(const volatile _Arg&, _Tuple& __tuple) const volatile
  8921.  {
  8922.    return std::forward<typename result<_Mu(_Arg, _Tuple)>::type>(
  8923.        ::std::get<(is_placeholder<_Arg>::value - 1)>(__tuple));
  8924.  }
  8925.     };
  8926.   template<typename _Arg>
  8927.     class _Mu<_Arg, false, false>
  8928.     {
  8929.     public:
  8930.       template<typename _Signature> struct result;
  8931.       template<typename _CVMu, typename _CVArg, typename _Tuple>
  8932.  struct result<_CVMu(_CVArg, _Tuple)>
  8933.  {
  8934.    typedef typename add_lvalue_reference<_CVArg>::type type;
  8935.  };
  8936.       template<typename _CVArg, typename _Tuple>
  8937.  _CVArg&&
  8938.  operator()(_CVArg&& __arg, _Tuple&) const volatile
  8939.  { return std::forward<_CVArg>(__arg); }
  8940.     };
  8941.   template<typename _Tp>
  8942.     struct _Maybe_wrap_member_pointer
  8943.     {
  8944.       typedef _Tp type;
  8945.       static const _Tp&
  8946.       __do_wrap(const _Tp& __x)
  8947.       { return __x; }
  8948.       static _Tp&&
  8949.       __do_wrap(_Tp&& __x)
  8950.       { return static_cast<_Tp&&>(__x); }
  8951.     };
  8952.   template<typename _Tp, typename _Class>
  8953.     struct _Maybe_wrap_member_pointer<_Tp _Class::*>
  8954.     {
  8955.       typedef _Mem_fn<_Tp _Class::*> type;
  8956.       static type
  8957.       __do_wrap(_Tp _Class::* __pm)
  8958.       { return type(__pm); }
  8959.     };
  8960.   template<>
  8961.     struct _Maybe_wrap_member_pointer<void>
  8962.     {
  8963.       typedef void type;
  8964.     };
  8965.   template<std::size_t _Ind, typename... _Tp>
  8966.     inline auto
  8967.     __volget(volatile tuple<_Tp...>& __tuple)
  8968.     -> typename tuple_element<_Ind, tuple<_Tp...>>::type volatile&
  8969.     { return std::get<_Ind>(const_cast<tuple<_Tp...>&>(__tuple)); }
  8970.   template<std::size_t _Ind, typename... _Tp>
  8971.     inline auto
  8972.     __volget(const volatile tuple<_Tp...>& __tuple)
  8973.     -> typename tuple_element<_Ind, tuple<_Tp...>>::type const volatile&
  8974.     { return std::get<_Ind>(const_cast<const tuple<_Tp...>&>(__tuple)); }
  8975.   template<typename _Signature>
  8976.     struct _Bind;
  8977.    template<typename _Functor, typename... _Bound_args>
  8978.     class _Bind<_Functor(_Bound_args...)>
  8979.     : public _Weak_result_type<_Functor>
  8980.     {
  8981.       typedef _Bind __self_type;
  8982.       typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
  8983.  _Bound_indexes;
  8984.       _Functor _M_f;
  8985.       tuple<_Bound_args...> _M_bound_args;
  8986.       template<typename _Result, typename... _Args, std::size_t... _Indexes>
  8987.  _Result
  8988.  __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>)
  8989.  {
  8990.    return _M_f(_Mu<_Bound_args>()
  8991.         (get<_Indexes>(_M_bound_args), __args)...);
  8992.  }
  8993.       template<typename _Result, typename... _Args, std::size_t... _Indexes>
  8994.  _Result
  8995.  __call_c(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>) const
  8996.  {
  8997.    return _M_f(_Mu<_Bound_args>()
  8998.         (get<_Indexes>(_M_bound_args), __args)...);
  8999.  }
  9000.       template<typename _Result, typename... _Args, std::size_t... _Indexes>
  9001.  _Result
  9002.  __call_v(tuple<_Args...>&& __args,
  9003.    _Index_tuple<_Indexes...>) volatile
  9004.  {
  9005.    return _M_f(_Mu<_Bound_args>()
  9006.         (__volget<_Indexes>(_M_bound_args), __args)...);
  9007.  }
  9008.       template<typename _Result, typename... _Args, std::size_t... _Indexes>
  9009.  _Result
  9010.  __call_c_v(tuple<_Args...>&& __args,
  9011.      _Index_tuple<_Indexes...>) const volatile
  9012.  {
  9013.    return _M_f(_Mu<_Bound_args>()
  9014.         (__volget<_Indexes>(_M_bound_args), __args)...);
  9015.  }
  9016.      public:
  9017.       template<typename... _Args>
  9018.  explicit _Bind(const _Functor& __f, _Args&&... __args)
  9019.  : _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...)
  9020.  { }
  9021.       template<typename... _Args>
  9022.  explicit _Bind(_Functor&& __f, _Args&&... __args)
  9023.  : _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...)
  9024.  { }
  9025.       _Bind(const _Bind&) = default;
  9026.       _Bind(_Bind&& __b)
  9027.       : _M_f(std::move(__b._M_f)), _M_bound_args(std::move(__b._M_bound_args))
  9028.       { }
  9029.       template<typename... _Args, typename _Result
  9030.  = decltype( std::declval<_Functor>()(
  9031.        _Mu<_Bound_args>()( std::declval<_Bound_args&>(),
  9032.       std::declval<tuple<_Args...>&>() )... ) )>
  9033.  _Result
  9034.  operator()(_Args&&... __args)
  9035.  {
  9036.    return this->__call<_Result>(
  9037.        std::forward_as_tuple(std::forward<_Args>(__args)...),
  9038.        _Bound_indexes());
  9039.  }
  9040.       template<typename... _Args, typename _Result
  9041.  = decltype( std::declval<typename enable_if<(sizeof...(_Args) >= 0),
  9042.          typename add_const<_Functor>::type>::type>()(
  9043.        _Mu<_Bound_args>()( std::declval<const _Bound_args&>(),
  9044.       std::declval<tuple<_Args...>&>() )... ) )>
  9045.  _Result
  9046.  operator()(_Args&&... __args) const
  9047.  {
  9048.    return this->__call_c<_Result>(
  9049.        std::forward_as_tuple(std::forward<_Args>(__args)...),
  9050.        _Bound_indexes());
  9051.  }
  9052.       template<typename... _Args, typename _Result
  9053.  = decltype( std::declval<typename enable_if<(sizeof...(_Args) >= 0),
  9054.                        typename add_volatile<_Functor>::type>::type>()(
  9055.        _Mu<_Bound_args>()( std::declval<volatile _Bound_args&>(),
  9056.       std::declval<tuple<_Args...>&>() )... ) )>
  9057.  _Result
  9058.  operator()(_Args&&... __args) volatile
  9059.  {
  9060.    return this->__call_v<_Result>(
  9061.        std::forward_as_tuple(std::forward<_Args>(__args)...),
  9062.        _Bound_indexes());
  9063.  }
  9064.       template<typename... _Args, typename _Result
  9065.  = decltype( std::declval<typename enable_if<(sizeof...(_Args) >= 0),
  9066.                        typename add_cv<_Functor>::type>::type>()(
  9067.        _Mu<_Bound_args>()( std::declval<const volatile _Bound_args&>(),
  9068.       std::declval<tuple<_Args...>&>() )... ) )>
  9069.  _Result
  9070.  operator()(_Args&&... __args) const volatile
  9071.  {
  9072.    return this->__call_c_v<_Result>(
  9073.        std::forward_as_tuple(std::forward<_Args>(__args)...),
  9074.        _Bound_indexes());
  9075.  }
  9076.     };
  9077.   template<typename _Result, typename _Signature>
  9078.     struct _Bind_result;
  9079.   template<typename _Result, typename _Functor, typename... _Bound_args>
  9080.     class _Bind_result<_Result, _Functor(_Bound_args...)>
  9081.     {
  9082.       typedef _Bind_result __self_type;
  9083.       typedef typename _Build_index_tuple<sizeof...(_Bound_args)>::__type
  9084.  _Bound_indexes;
  9085.       _Functor _M_f;
  9086.       tuple<_Bound_args...> _M_bound_args;
  9087.       template<typename _Res>
  9088.  struct __enable_if_void : enable_if<is_void<_Res>::value, int> { };
  9089.       template<typename _Res>
  9090.  struct __disable_if_void : enable_if<!is_void<_Res>::value, int> { };
  9091.       template<typename _Res, typename... _Args, std::size_t... _Indexes>
  9092.  _Result
  9093.  __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
  9094.      typename __disable_if_void<_Res>::type = 0)
  9095.  {
  9096.    return _M_f(_Mu<_Bound_args>()
  9097.         (get<_Indexes>(_M_bound_args), __args)...);
  9098.  }
  9099.       template<typename _Res, typename... _Args, std::size_t... _Indexes>
  9100.  void
  9101.  __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
  9102.      typename __enable_if_void<_Res>::type = 0)
  9103.  {
  9104.    _M_f(_Mu<_Bound_args>()
  9105.         (get<_Indexes>(_M_bound_args), __args)...);
  9106.  }
  9107.       template<typename _Res, typename... _Args, std::size_t... _Indexes>
  9108.  _Result
  9109.  __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
  9110.      typename __disable_if_void<_Res>::type = 0) const
  9111.  {
  9112.    return _M_f(_Mu<_Bound_args>()
  9113.         (get<_Indexes>(_M_bound_args), __args)...);
  9114.  }
  9115.       template<typename _Res, typename... _Args, std::size_t... _Indexes>
  9116.  void
  9117.  __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
  9118.      typename __enable_if_void<_Res>::type = 0) const
  9119.  {
  9120.    _M_f(_Mu<_Bound_args>()
  9121.         (get<_Indexes>(_M_bound_args), __args)...);
  9122.  }
  9123.       template<typename _Res, typename... _Args, std::size_t... _Indexes>
  9124.  _Result
  9125.  __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
  9126.      typename __disable_if_void<_Res>::type = 0) volatile
  9127.  {
  9128.    return _M_f(_Mu<_Bound_args>()
  9129.         (__volget<_Indexes>(_M_bound_args), __args)...);
  9130.  }
  9131.       template<typename _Res, typename... _Args, std::size_t... _Indexes>
  9132.  void
  9133.  __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
  9134.      typename __enable_if_void<_Res>::type = 0) volatile
  9135.  {
  9136.    _M_f(_Mu<_Bound_args>()
  9137.         (__volget<_Indexes>(_M_bound_args), __args)...);
  9138.  }
  9139.       template<typename _Res, typename... _Args, std::size_t... _Indexes>
  9140.  _Result
  9141.  __call(tuple<_Args...>&& __args, _Index_tuple<_Indexes...>,
  9142.      typename __disable_if_void<_Res>::type = 0) const volatile
  9143.  {
  9144.    return _M_f(_Mu<_Bound_args>()
  9145.         (__volget<_Indexes>(_M_bound_args), __args)...);
  9146.  }
  9147.       template<typename _Res, typename... _Args, std::size_t... _Indexes>
  9148.  void
  9149.  __call(tuple<_Args...>&& __args,
  9150.         _Index_tuple<_Indexes...>,
  9151.      typename __enable_if_void<_Res>::type = 0) const volatile
  9152.  {
  9153.    _M_f(_Mu<_Bound_args>()
  9154.         (__volget<_Indexes>(_M_bound_args), __args)...);
  9155.  }
  9156.     public:
  9157.       typedef _Result result_type;
  9158.       template<typename... _Args>
  9159.  explicit _Bind_result(const _Functor& __f, _Args&&... __args)
  9160.  : _M_f(__f), _M_bound_args(std::forward<_Args>(__args)...)
  9161.  { }
  9162.       template<typename... _Args>
  9163.  explicit _Bind_result(_Functor&& __f, _Args&&... __args)
  9164.  : _M_f(std::move(__f)), _M_bound_args(std::forward<_Args>(__args)...)
  9165.  { }
  9166.       _Bind_result(const _Bind_result&) = default;
  9167.       _Bind_result(_Bind_result&& __b)
  9168.       : _M_f(std::move(__b._M_f)), _M_bound_args(std::move(__b._M_bound_args))
  9169.       { }
  9170.       template<typename... _Args>
  9171.  result_type
  9172.  operator()(_Args&&... __args)
  9173.  {
  9174.    return this->__call<_Result>(
  9175.        std::forward_as_tuple(std::forward<_Args>(__args)...),
  9176.        _Bound_indexes());
  9177.  }
  9178.       template<typename... _Args>
  9179.  result_type
  9180.  operator()(_Args&&... __args) const
  9181.  {
  9182.    return this->__call<_Result>(
  9183.        std::forward_as_tuple(std::forward<_Args>(__args)...),
  9184.        _Bound_indexes());
  9185.  }
  9186.       template<typename... _Args>
  9187.  result_type
  9188.  operator()(_Args&&... __args) volatile
  9189.  {
  9190.    return this->__call<_Result>(
  9191.        std::forward_as_tuple(std::forward<_Args>(__args)...),
  9192.        _Bound_indexes());
  9193.  }
  9194.       template<typename... _Args>
  9195.  result_type
  9196.  operator()(_Args&&... __args) const volatile
  9197.  {
  9198.    return this->__call<_Result>(
  9199.        std::forward_as_tuple(std::forward<_Args>(__args)...),
  9200.        _Bound_indexes());
  9201.  }
  9202.     };
  9203.   template<typename _Signature>
  9204.     struct is_bind_expression<_Bind<_Signature> >
  9205.     : public true_type { };
  9206.   template<typename _Signature>
  9207.     struct is_bind_expression<const _Bind<_Signature> >
  9208.     : public true_type { };
  9209.   template<typename _Signature>
  9210.     struct is_bind_expression<volatile _Bind<_Signature> >
  9211.     : public true_type { };
  9212.   template<typename _Signature>
  9213.     struct is_bind_expression<const volatile _Bind<_Signature>>
  9214.     : public true_type { };
  9215.   template<typename _Result, typename _Signature>
  9216.     struct is_bind_expression<_Bind_result<_Result, _Signature>>
  9217.     : public true_type { };
  9218.   template<typename _Result, typename _Signature>
  9219.     struct is_bind_expression<const _Bind_result<_Result, _Signature>>
  9220.     : public true_type { };
  9221.   template<typename _Result, typename _Signature>
  9222.     struct is_bind_expression<volatile _Bind_result<_Result, _Signature>>
  9223.     : public true_type { };
  9224.   template<typename _Result, typename _Signature>
  9225.     struct is_bind_expression<const volatile _Bind_result<_Result, _Signature>>
  9226.     : public true_type { };
  9227.   template<typename _Tp>
  9228.     class __is_socketlike
  9229.     {
  9230.       typedef typename decay<_Tp>::type _Tp2;
  9231.     public:
  9232.       static const bool value =
  9233.  is_integral<_Tp2>::value || is_enum<_Tp2>::value;
  9234.     };
  9235.   template<bool _SocketLike, typename _Func, typename... _BoundArgs>
  9236.     struct _Bind_helper
  9237.     {
  9238.       typedef _Maybe_wrap_member_pointer<typename decay<_Func>::type>
  9239.  __maybe_type;
  9240.       typedef typename __maybe_type::type __func_type;
  9241.       typedef _Bind<__func_type(typename decay<_BoundArgs>::type...)> type;
  9242.     };
  9243.   template<typename _Func, typename... _BoundArgs>
  9244.     struct _Bind_helper<true, _Func, _BoundArgs...>
  9245.     { };
  9246.   template<typename _Func, typename... _BoundArgs>
  9247.     inline typename
  9248.     _Bind_helper<__is_socketlike<_Func>::value, _Func, _BoundArgs...>::type
  9249.     bind(_Func&& __f, _BoundArgs&&... __args)
  9250.     {
  9251.       typedef _Bind_helper<false, _Func, _BoundArgs...> __helper_type;
  9252.       typedef typename __helper_type::__maybe_type __maybe_type;
  9253.       typedef typename __helper_type::type __result_type;
  9254.       return __result_type(__maybe_type::__do_wrap(std::forward<_Func>(__f)),
  9255.       std::forward<_BoundArgs>(__args)...);
  9256.     }
  9257.   template<typename _Result, typename _Func, typename... _BoundArgs>
  9258.     struct _Bindres_helper
  9259.     {
  9260.       typedef _Maybe_wrap_member_pointer<typename decay<_Func>::type>
  9261.  __maybe_type;
  9262.       typedef typename __maybe_type::type __functor_type;
  9263.       typedef _Bind_result<_Result,
  9264.       __functor_type(typename decay<_BoundArgs>::type...)>
  9265.  type;
  9266.     };
  9267.   template<typename _Result, typename _Func, typename... _BoundArgs>
  9268.     inline
  9269.     typename _Bindres_helper<_Result, _Func, _BoundArgs...>::type
  9270.     bind(_Func&& __f, _BoundArgs&&... __args)
  9271.     {
  9272.       typedef _Bindres_helper<_Result, _Func, _BoundArgs...> __helper_type;
  9273.       typedef typename __helper_type::__maybe_type __maybe_type;
  9274.       typedef typename __helper_type::type __result_type;
  9275.       return __result_type(__maybe_type::__do_wrap(std::forward<_Func>(__f)),
  9276.       std::forward<_BoundArgs>(__args)...);
  9277.     }
  9278.   template<typename _Signature>
  9279.     struct _Bind_simple;
  9280.   template<typename _Callable, typename... _Args>
  9281.     struct _Bind_simple<_Callable(_Args...)>
  9282.     {
  9283.       typedef typename result_of<_Callable(_Args...)>::type result_type;
  9284.       template<typename... _Args2, typename = typename
  9285.                enable_if< sizeof...(_Args) == sizeof...(_Args2)>::type>
  9286.         explicit
  9287.         _Bind_simple(const _Callable& __callable, _Args2&&... __args)
  9288.         : _M_bound(__callable, std::forward<_Args2>(__args)...)
  9289.         { }
  9290.       template<typename... _Args2, typename = typename
  9291.                enable_if< sizeof...(_Args) == sizeof...(_Args2)>::type>
  9292.         explicit
  9293.         _Bind_simple(_Callable&& __callable, _Args2&&... __args)
  9294.         : _M_bound(std::move(__callable), std::forward<_Args2>(__args)...)
  9295.         { }
  9296.       _Bind_simple(const _Bind_simple&) = default;
  9297.       _Bind_simple(_Bind_simple&&) = default;
  9298.       result_type
  9299.       operator()()
  9300.       {
  9301.         typedef typename _Build_index_tuple<sizeof...(_Args)>::__type _Indices;
  9302.         return _M_invoke(_Indices());
  9303.       }
  9304.     private:
  9305.       template<std::size_t... _Indices>
  9306.         typename result_of<_Callable(_Args...)>::type
  9307.         _M_invoke(_Index_tuple<_Indices...>)
  9308.         {
  9309.           return std::forward<_Callable>(std::get<0>(_M_bound))(
  9310.               std::forward<_Args>(std::get<_Indices+1>(_M_bound))...);
  9311.         }
  9312.       std::tuple<_Callable, _Args...> _M_bound;
  9313.     };
  9314.   template<typename _Func, typename... _BoundArgs>
  9315.     struct _Bind_simple_helper
  9316.     {
  9317.       typedef _Maybe_wrap_member_pointer<typename decay<_Func>::type>
  9318.         __maybe_type;
  9319.       typedef typename __maybe_type::type __func_type;
  9320.       typedef _Bind_simple<__func_type(typename decay<_BoundArgs>::type...)>
  9321.         __type;
  9322.     };
  9323.   template<typename _Callable, typename... _Args>
  9324.     typename _Bind_simple_helper<_Callable, _Args...>::__type
  9325.     __bind_simple(_Callable&& __callable, _Args&&... __args)
  9326.     {
  9327.       typedef _Bind_simple_helper<_Callable, _Args...> __helper_type;
  9328.       typedef typename __helper_type::__maybe_type __maybe_type;
  9329.       typedef typename __helper_type::__type __result_type;
  9330.       return __result_type(
  9331.           __maybe_type::__do_wrap( std::forward<_Callable>(__callable)),
  9332.           std::forward<_Args>(__args)...);
  9333.     }
  9334.   class bad_function_call : public std::exception
  9335.   {
  9336.   public:
  9337.     virtual ~bad_function_call() noexcept;
  9338.   };
  9339.   template<typename _Tp>
  9340.     struct __is_location_invariant
  9341.     : integral_constant<bool, (is_pointer<_Tp>::value
  9342.           || is_member_pointer<_Tp>::value)>
  9343.     { };
  9344.   class _Undefined_class;
  9345.   union _Nocopy_types
  9346.   {
  9347.     void* _M_object;
  9348.     const void* _M_const_object;
  9349.     void (*_M_function_pointer)();
  9350.     void (_Undefined_class::*_M_member_pointer)();
  9351.   };
  9352.   union _Any_data
  9353.   {
  9354.     void* _M_access() { return &_M_pod_data[0]; }
  9355.     const void* _M_access() const { return &_M_pod_data[0]; }
  9356.     template<typename _Tp>
  9357.       _Tp&
  9358.       _M_access()
  9359.       { return *static_cast<_Tp*>(_M_access()); }
  9360.     template<typename _Tp>
  9361.       const _Tp&
  9362.       _M_access() const
  9363.       { return *static_cast<const _Tp*>(_M_access()); }
  9364.     _Nocopy_types _M_unused;
  9365.     char _M_pod_data[sizeof(_Nocopy_types)];
  9366.   };
  9367.   enum _Manager_operation
  9368.   {
  9369.     __get_type_info,
  9370.     __get_functor_ptr,
  9371.     __clone_functor,
  9372.     __destroy_functor
  9373.   };
  9374.   template<typename _Tp>
  9375.     struct _Simple_type_wrapper
  9376.     {
  9377.       _Simple_type_wrapper(_Tp __value) : __value(__value) { }
  9378.       _Tp __value;
  9379.     };
  9380.   template<typename _Tp>
  9381.     struct __is_location_invariant<_Simple_type_wrapper<_Tp> >
  9382.     : __is_location_invariant<_Tp>
  9383.     { };
  9384.   template<typename _Functor>
  9385.     inline _Functor&
  9386.     __callable_functor(_Functor& __f)
  9387.     { return __f; }
  9388.   template<typename _Member, typename _Class>
  9389.     inline _Mem_fn<_Member _Class::*>
  9390.     __callable_functor(_Member _Class::* &__p)
  9391.     { return mem_fn(__p); }
  9392.   template<typename _Member, typename _Class>
  9393.     inline _Mem_fn<_Member _Class::*>
  9394.     __callable_functor(_Member _Class::* const &__p)
  9395.     { return mem_fn(__p); }
  9396.   template<typename _Signature>
  9397.     class function;
  9398.   class _Function_base
  9399.   {
  9400.   public:
  9401.     static const std::size_t _M_max_size = sizeof(_Nocopy_types);
  9402.     static const std::size_t _M_max_align = __alignof__(_Nocopy_types);
  9403.     template<typename _Functor>
  9404.       class _Base_manager
  9405.       {
  9406.       protected:
  9407.  static const bool __stored_locally =
  9408.  (__is_location_invariant<_Functor>::value
  9409.   && sizeof(_Functor) <= _M_max_size
  9410.   && __alignof__(_Functor) <= _M_max_align
  9411.   && (_M_max_align % __alignof__(_Functor) == 0));
  9412.  typedef integral_constant<bool, __stored_locally> _Local_storage;
  9413.  static _Functor*
  9414.  _M_get_pointer(const _Any_data& __source)
  9415.  {
  9416.    const _Functor* __ptr =
  9417.      __stored_locally? std::__addressof(__source._M_access<_Functor>())
  9418.                                  : __source._M_access<_Functor*>();
  9419.    return const_cast<_Functor*>(__ptr);
  9420.  }
  9421.  static void
  9422.  _M_clone(_Any_data& __dest, const _Any_data& __source, true_type)
  9423.  {
  9424.    new (__dest._M_access()) _Functor(__source._M_access<_Functor>());
  9425.  }
  9426.  static void
  9427.  _M_clone(_Any_data& __dest, const _Any_data& __source, false_type)
  9428.  {
  9429.    __dest._M_access<_Functor*>() =
  9430.      new _Functor(*__source._M_access<_Functor*>());
  9431.  }
  9432.  static void
  9433.  _M_destroy(_Any_data& __victim, true_type)
  9434.  {
  9435.    __victim._M_access<_Functor>().~_Functor();
  9436.  }
  9437.  static void
  9438.  _M_destroy(_Any_data& __victim, false_type)
  9439.  {
  9440.    delete __victim._M_access<_Functor*>();
  9441.  }
  9442.       public:
  9443.  static bool
  9444.  _M_manager(_Any_data& __dest, const _Any_data& __source,
  9445.      _Manager_operation __op)
  9446.  {
  9447.    switch (__op)
  9448.      {
  9449.      case __get_type_info:
  9450.        __dest._M_access<const type_info*>() = &typeid(_Functor);
  9451.        break;
  9452.      case __get_functor_ptr:
  9453.        __dest._M_access<_Functor*>() = _M_get_pointer(__source);
  9454.        break;
  9455.      case __clone_functor:
  9456.        _M_clone(__dest, __source, _Local_storage());
  9457.        break;
  9458.      case __destroy_functor:
  9459.        _M_destroy(__dest, _Local_storage());
  9460.        break;
  9461.      }
  9462.    return false;
  9463.  }
  9464.  static void
  9465.  _M_init_functor(_Any_data& __functor, _Functor&& __f)
  9466.  { _M_init_functor(__functor, std::move(__f), _Local_storage()); }
  9467.  template<typename _Signature>
  9468.    static bool
  9469.    _M_not_empty_function(const function<_Signature>& __f)
  9470.    { return static_cast<bool>(__f); }
  9471.  template<typename _Tp>
  9472.    static bool
  9473.    _M_not_empty_function(const _Tp*& __fp)
  9474.    { return __fp; }
  9475.  template<typename _Class, typename _Tp>
  9476.    static bool
  9477.    _M_not_empty_function(_Tp _Class::* const& __mp)
  9478.    { return __mp; }
  9479.  template<typename _Tp>
  9480.    static bool
  9481.    _M_not_empty_function(const _Tp&)
  9482.    { return true; }
  9483.       private:
  9484.  static void
  9485.  _M_init_functor(_Any_data& __functor, _Functor&& __f, true_type)
  9486.  { new (__functor._M_access()) _Functor(std::move(__f)); }
  9487.  static void
  9488.  _M_init_functor(_Any_data& __functor, _Functor&& __f, false_type)
  9489.  { __functor._M_access<_Functor*>() = new _Functor(std::move(__f)); }
  9490.       };
  9491.     template<typename _Functor>
  9492.       class _Ref_manager : public _Base_manager<_Functor*>
  9493.       {
  9494.  typedef _Function_base::_Base_manager<_Functor*> _Base;
  9495.     public:
  9496.  static bool
  9497.  _M_manager(_Any_data& __dest, const _Any_data& __source,
  9498.      _Manager_operation __op)
  9499.  {
  9500.    switch (__op)
  9501.      {
  9502.      case __get_type_info:
  9503.        __dest._M_access<const type_info*>() = &typeid(_Functor);
  9504.        break;
  9505.      case __get_functor_ptr:
  9506.        __dest._M_access<_Functor*>() = *_Base::_M_get_pointer(__source);
  9507.        return is_const<_Functor>::value;
  9508.        break;
  9509.      default:
  9510.        _Base::_M_manager(__dest, __source, __op);
  9511.      }
  9512.    return false;
  9513.  }
  9514.  static void
  9515.  _M_init_functor(_Any_data& __functor, reference_wrapper<_Functor> __f)
  9516.  {
  9517.    _Base::_M_init_functor(__functor, &__f.get());
  9518.  }
  9519.       };
  9520.     _Function_base() : _M_manager(0) { }
  9521.     ~_Function_base()
  9522.     {
  9523.       if (_M_manager)
  9524.  _M_manager(_M_functor, _M_functor, __destroy_functor);
  9525.     }
  9526.     bool _M_empty() const { return !_M_manager; }
  9527.     typedef bool (*_Manager_type)(_Any_data&, const _Any_data&,
  9528.       _Manager_operation);
  9529.     _Any_data _M_functor;
  9530.     _Manager_type _M_manager;
  9531.   };
  9532.   template<typename _Signature, typename _Functor>
  9533.     class _Function_handler;
  9534.   template<typename _Res, typename _Functor, typename... _ArgTypes>
  9535.     class _Function_handler<_Res(_ArgTypes...), _Functor>
  9536.     : public _Function_base::_Base_manager<_Functor>
  9537.     {
  9538.       typedef _Function_base::_Base_manager<_Functor> _Base;
  9539.     public:
  9540.       static _Res
  9541.       _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
  9542.       {
  9543.  return (*_Base::_M_get_pointer(__functor))(
  9544.      std::forward<_ArgTypes>(__args)...);
  9545.       }
  9546.     };
  9547.   template<typename _Functor, typename... _ArgTypes>
  9548.     class _Function_handler<void(_ArgTypes...), _Functor>
  9549.     : public _Function_base::_Base_manager<_Functor>
  9550.     {
  9551.       typedef _Function_base::_Base_manager<_Functor> _Base;
  9552.      public:
  9553.       static void
  9554.       _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
  9555.       {
  9556.  (*_Base::_M_get_pointer(__functor))(
  9557.      std::forward<_ArgTypes>(__args)...);
  9558.       }
  9559.     };
  9560.   template<typename _Res, typename _Functor, typename... _ArgTypes>
  9561.     class _Function_handler<_Res(_ArgTypes...), reference_wrapper<_Functor> >
  9562.     : public _Function_base::_Ref_manager<_Functor>
  9563.     {
  9564.       typedef _Function_base::_Ref_manager<_Functor> _Base;
  9565.      public:
  9566.       static _Res
  9567.       _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
  9568.       {
  9569.  return __callable_functor(**_Base::_M_get_pointer(__functor))(
  9570.        std::forward<_ArgTypes>(__args)...);
  9571.       }
  9572.     };
  9573.   template<typename _Functor, typename... _ArgTypes>
  9574.     class _Function_handler<void(_ArgTypes...), reference_wrapper<_Functor> >
  9575.     : public _Function_base::_Ref_manager<_Functor>
  9576.     {
  9577.       typedef _Function_base::_Ref_manager<_Functor> _Base;
  9578.      public:
  9579.       static void
  9580.       _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
  9581.       {
  9582.  __callable_functor(**_Base::_M_get_pointer(__functor))(
  9583.      std::forward<_ArgTypes>(__args)...);
  9584.       }
  9585.     };
  9586.   template<typename _Class, typename _Member, typename _Res,
  9587.     typename... _ArgTypes>
  9588.     class _Function_handler<_Res(_ArgTypes...), _Member _Class::*>
  9589.     : public _Function_handler<void(_ArgTypes...), _Member _Class::*>
  9590.     {
  9591.       typedef _Function_handler<void(_ArgTypes...), _Member _Class::*>
  9592.  _Base;
  9593.      public:
  9594.       static _Res
  9595.       _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
  9596.       {
  9597.  return mem_fn(_Base::_M_get_pointer(__functor)->__value)(
  9598.      std::forward<_ArgTypes>(__args)...);
  9599.       }
  9600.     };
  9601.   template<typename _Class, typename _Member, typename... _ArgTypes>
  9602.     class _Function_handler<void(_ArgTypes...), _Member _Class::*>
  9603.     : public _Function_base::_Base_manager<
  9604.    _Simple_type_wrapper< _Member _Class::* > >
  9605.     {
  9606.       typedef _Member _Class::* _Functor;
  9607.       typedef _Simple_type_wrapper<_Functor> _Wrapper;
  9608.       typedef _Function_base::_Base_manager<_Wrapper> _Base;
  9609.      public:
  9610.       static bool
  9611.       _M_manager(_Any_data& __dest, const _Any_data& __source,
  9612.    _Manager_operation __op)
  9613.       {
  9614.  switch (__op)
  9615.    {
  9616.    case __get_type_info:
  9617.      __dest._M_access<const type_info*>() = &typeid(_Functor);
  9618.      break;
  9619.    case __get_functor_ptr:
  9620.      __dest._M_access<_Functor*>() =
  9621.        &_Base::_M_get_pointer(__source)->__value;
  9622.      break;
  9623.    default:
  9624.      _Base::_M_manager(__dest, __source, __op);
  9625.    }
  9626.  return false;
  9627.       }
  9628.       static void
  9629.       _M_invoke(const _Any_data& __functor, _ArgTypes... __args)
  9630.       {
  9631.  mem_fn(_Base::_M_get_pointer(__functor)->__value)(
  9632.      std::forward<_ArgTypes>(__args)...);
  9633.       }
  9634.     };
  9635.   template<typename _Res, typename... _ArgTypes>
  9636.     class function<_Res(_ArgTypes...)>
  9637.     : public _Maybe_unary_or_binary_function<_Res, _ArgTypes...>,
  9638.       private _Function_base
  9639.     {
  9640.       typedef _Res _Signature_type(_ArgTypes...);
  9641.       struct _Useless { };
  9642.     public:
  9643.       typedef _Res result_type;
  9644.       function() noexcept
  9645.       : _Function_base() { }
  9646.       function(nullptr_t) noexcept
  9647.       : _Function_base() { }
  9648.       function(const function& __x);
  9649.       function(function&& __x) : _Function_base()
  9650.       {
  9651.  __x.swap(*this);
  9652.       }
  9653.       template<typename _Functor>
  9654.  function(_Functor __f,
  9655.    typename enable_if<
  9656.       !is_integral<_Functor>::value, _Useless>::type
  9657.      = _Useless());
  9658.       function&
  9659.       operator=(const function& __x)
  9660.       {
  9661.  function(__x).swap(*this);
  9662.  return *this;
  9663.       }
  9664.       function&
  9665.       operator=(function&& __x)
  9666.       {
  9667.  function(std::move(__x)).swap(*this);
  9668.  return *this;
  9669.       }
  9670.       function&
  9671.       operator=(nullptr_t)
  9672.       {
  9673.  if (_M_manager)
  9674.    {
  9675.      _M_manager(_M_functor, _M_functor, __destroy_functor);
  9676.      _M_manager = 0;
  9677.      _M_invoker = 0;
  9678.    }
  9679.  return *this;
  9680.       }
  9681.       template<typename _Functor>
  9682.  typename enable_if<!is_integral<_Functor>::value, function&>::type
  9683.  operator=(_Functor&& __f)
  9684.  {
  9685.    function(std::forward<_Functor>(__f)).swap(*this);
  9686.    return *this;
  9687.  }
  9688.       template<typename _Functor>
  9689.  typename enable_if<!is_integral<_Functor>::value, function&>::type
  9690.  operator=(reference_wrapper<_Functor> __f) noexcept
  9691.  {
  9692.    function(__f).swap(*this);
  9693.    return *this;
  9694.  }
  9695.       void swap(function& __x)
  9696.       {
  9697.  std::swap(_M_functor, __x._M_functor);
  9698.  std::swap(_M_manager, __x._M_manager);
  9699.  std::swap(_M_invoker, __x._M_invoker);
  9700.       }
  9701.       explicit operator bool() const noexcept
  9702.       { return !_M_empty(); }
  9703.       _Res operator()(_ArgTypes... __args) const;
  9704.       const type_info& target_type() const noexcept;
  9705.       template<typename _Functor> _Functor* target() noexcept;
  9706.       template<typename _Functor> const _Functor* target() const noexcept;
  9707.     private:
  9708.       typedef _Res (*_Invoker_type)(const _Any_data&, _ArgTypes...);
  9709.       _Invoker_type _M_invoker;
  9710.   };
  9711.   template<typename _Res, typename... _ArgTypes>
  9712.     function<_Res(_ArgTypes...)>::
  9713.     function(const function& __x)
  9714.     : _Function_base()
  9715.     {
  9716.       if (static_cast<bool>(__x))
  9717.  {
  9718.    _M_invoker = __x._M_invoker;
  9719.    _M_manager = __x._M_manager;
  9720.    __x._M_manager(_M_functor, __x._M_functor, __clone_functor);
  9721.  }
  9722.     }
  9723.   template<typename _Res, typename... _ArgTypes>
  9724.     template<typename _Functor>
  9725.       function<_Res(_ArgTypes...)>::
  9726.       function(_Functor __f,
  9727.         typename enable_if<
  9728.    !is_integral<_Functor>::value, _Useless>::type)
  9729.       : _Function_base()
  9730.       {
  9731.  typedef _Function_handler<_Signature_type, _Functor> _My_handler;
  9732.  if (_My_handler::_M_not_empty_function(__f))
  9733.    {
  9734.      _M_invoker = &_My_handler::_M_invoke;
  9735.      _M_manager = &_My_handler::_M_manager;
  9736.      _My_handler::_M_init_functor(_M_functor, std::move(__f));
  9737.    }
  9738.       }
  9739.   template<typename _Res, typename... _ArgTypes>
  9740.     _Res
  9741.     function<_Res(_ArgTypes...)>::
  9742.     operator()(_ArgTypes... __args) const
  9743.     {
  9744.       if (_M_empty())
  9745.  __throw_bad_function_call();
  9746.       return _M_invoker(_M_functor, std::forward<_ArgTypes>(__args)...);
  9747.     }
  9748.   template<typename _Res, typename... _ArgTypes>
  9749.     const type_info&
  9750.     function<_Res(_ArgTypes...)>::
  9751.     target_type() const noexcept
  9752.     {
  9753.       if (_M_manager)
  9754.  {
  9755.    _Any_data __typeinfo_result;
  9756.    _M_manager(__typeinfo_result, _M_functor, __get_type_info);
  9757.    return *__typeinfo_result._M_access<const type_info*>();
  9758.  }
  9759.       else
  9760.  return typeid(void);
  9761.     }
  9762.   template<typename _Res, typename... _ArgTypes>
  9763.     template<typename _Functor>
  9764.       _Functor*
  9765.       function<_Res(_ArgTypes...)>::
  9766.       target() noexcept
  9767.       {
  9768.  if (typeid(_Functor) == target_type() && _M_manager)
  9769.    {
  9770.      _Any_data __ptr;
  9771.      if (_M_manager(__ptr, _M_functor, __get_functor_ptr)
  9772.   && !is_const<_Functor>::value)
  9773.        return 0;
  9774.      else
  9775.        return __ptr._M_access<_Functor*>();
  9776.    }
  9777.  else
  9778.    return 0;
  9779.       }
  9780.   template<typename _Res, typename... _ArgTypes>
  9781.     template<typename _Functor>
  9782.       const _Functor*
  9783.       function<_Res(_ArgTypes...)>::
  9784.       target() const noexcept
  9785.       {
  9786.  if (typeid(_Functor) == target_type() && _M_manager)
  9787.    {
  9788.      _Any_data __ptr;
  9789.      _M_manager(__ptr, _M_functor, __get_functor_ptr);
  9790.      return __ptr._M_access<const _Functor*>();
  9791.    }
  9792.  else
  9793.    return 0;
  9794.       }
  9795.   template<typename _Res, typename... _Args>
  9796.     inline bool
  9797.     operator==(const function<_Res(_Args...)>& __f, nullptr_t) noexcept
  9798.     { return !static_cast<bool>(__f); }
  9799.   template<typename _Res, typename... _Args>
  9800.     inline bool
  9801.     operator==(nullptr_t, const function<_Res(_Args...)>& __f) noexcept
  9802.     { return !static_cast<bool>(__f); }
  9803.   template<typename _Res, typename... _Args>
  9804.     inline bool
  9805.     operator!=(const function<_Res(_Args...)>& __f, nullptr_t) noexcept
  9806.     { return static_cast<bool>(__f); }
  9807.   template<typename _Res, typename... _Args>
  9808.     inline bool
  9809.     operator!=(nullptr_t, const function<_Res(_Args...)>& __f) noexcept
  9810.     { return static_cast<bool>(__f); }
  9811.   template<typename _Res, typename... _Args>
  9812.     inline void
  9813.     swap(function<_Res(_Args...)>& __x, function<_Res(_Args...)>& __y)
  9814.     { __x.swap(__y); }
  9815.  
  9816. }
  9817. namespace std __attribute__ ((__visibility__ ("default")))
  9818. {
  9819.  
  9820.   template<typename _Tp1>
  9821.     struct auto_ptr_ref
  9822.     {
  9823.       _Tp1* _M_ptr;
  9824.       explicit
  9825.       auto_ptr_ref(_Tp1* __p): _M_ptr(__p) { }
  9826.     } __attribute__ ((__deprecated__));
  9827.   template<typename _Tp>
  9828.     class auto_ptr
  9829.     {
  9830.     private:
  9831.       _Tp* _M_ptr;
  9832.     public:
  9833.       typedef _Tp element_type;
  9834.       explicit
  9835.       auto_ptr(element_type* __p = 0) throw() : _M_ptr(__p) { }
  9836.       auto_ptr(auto_ptr& __a) throw() : _M_ptr(__a.release()) { }
  9837.       template<typename _Tp1>
  9838.         auto_ptr(auto_ptr<_Tp1>& __a) throw() : _M_ptr(__a.release()) { }
  9839.       auto_ptr&
  9840.       operator=(auto_ptr& __a) throw()
  9841.       {
  9842.  reset(__a.release());
  9843.  return *this;
  9844.       }
  9845.       template<typename _Tp1>
  9846.         auto_ptr&
  9847.         operator=(auto_ptr<_Tp1>& __a) throw()
  9848.         {
  9849.    reset(__a.release());
  9850.    return *this;
  9851.  }
  9852.       ~auto_ptr() { delete _M_ptr; }
  9853.       element_type&
  9854.       operator*() const throw()
  9855.       {
  9856.  ;
  9857.  return *_M_ptr;
  9858.       }
  9859.       element_type*
  9860.       operator->() const throw()
  9861.       {
  9862.  ;
  9863.  return _M_ptr;
  9864.       }
  9865.       element_type*
  9866.       get() const throw() { return _M_ptr; }
  9867.       element_type*
  9868.       release() throw()
  9869.       {
  9870.  element_type* __tmp = _M_ptr;
  9871.  _M_ptr = 0;
  9872.  return __tmp;
  9873.       }
  9874.       void
  9875.       reset(element_type* __p = 0) throw()
  9876.       {
  9877.  if (__p != _M_ptr)
  9878.    {
  9879.      delete _M_ptr;
  9880.      _M_ptr = __p;
  9881.    }
  9882.       }
  9883.       auto_ptr(auto_ptr_ref<element_type> __ref) throw()
  9884.       : _M_ptr(__ref._M_ptr) { }
  9885.       auto_ptr&
  9886.       operator=(auto_ptr_ref<element_type> __ref) throw()
  9887.       {
  9888.  if (__ref._M_ptr != this->get())
  9889.    {
  9890.      delete _M_ptr;
  9891.      _M_ptr = __ref._M_ptr;
  9892.    }
  9893.  return *this;
  9894.       }
  9895.       template<typename _Tp1>
  9896.         operator auto_ptr_ref<_Tp1>() throw()
  9897.         { return auto_ptr_ref<_Tp1>(this->release()); }
  9898.       template<typename _Tp1>
  9899.         operator auto_ptr<_Tp1>() throw()
  9900.         { return auto_ptr<_Tp1>(this->release()); }
  9901.     } __attribute__ ((__deprecated__));
  9902.   template<>
  9903.     class auto_ptr<void>
  9904.     {
  9905.     public:
  9906.       typedef void element_type;
  9907.     } __attribute__ ((__deprecated__));
  9908.  
  9909. }
  9910. namespace std __attribute__ ((__visibility__ ("default")))
  9911. {
  9912.  
  9913.   template<typename _Tp>
  9914.     struct default_delete
  9915.     {
  9916.       constexpr default_delete() noexcept = default;
  9917.       template<typename _Up, typename = typename
  9918.         std::enable_if<std::is_convertible<_Up*, _Tp*>::value>::type>
  9919.         default_delete(const default_delete<_Up>&) noexcept { }
  9920.       void
  9921.       operator()(_Tp* __ptr) const
  9922.       {
  9923.  static_assert(sizeof(_Tp)>0,
  9924.         "can't delete pointer to incomplete type");
  9925.  delete __ptr;
  9926.       }
  9927.     };
  9928.   template<typename _Tp>
  9929.     struct default_delete<_Tp[]>
  9930.     {
  9931.       constexpr default_delete() noexcept = default;
  9932.       void
  9933.       operator()(_Tp* __ptr) const
  9934.       {
  9935.  static_assert(sizeof(_Tp)>0,
  9936.         "can't delete pointer to incomplete type");
  9937.  delete [] __ptr;
  9938.       }
  9939.       template<typename _Up> void operator()(_Up*) const = delete;
  9940.     };
  9941.   template <typename _Tp, typename _Dp = default_delete<_Tp> >
  9942.     class unique_ptr
  9943.     {
  9944.       class _Pointer
  9945.       {
  9946.  template<typename _Up>
  9947.    static typename _Up::pointer __test(typename _Up::pointer*);
  9948.  template<typename _Up>
  9949.    static _Tp* __test(...);
  9950.  typedef typename remove_reference<_Dp>::type _Del;
  9951.       public:
  9952.  typedef decltype( __test<_Del>(0)) type;
  9953.       };
  9954.       typedef std::tuple<typename _Pointer::type, _Dp> __tuple_type;
  9955.       __tuple_type _M_t;
  9956.     public:
  9957.       typedef typename _Pointer::type pointer;
  9958.       typedef _Tp element_type;
  9959.       typedef _Dp deleter_type;
  9960.       constexpr unique_ptr() noexcept
  9961.       : _M_t()
  9962.       { static_assert(!std::is_pointer<deleter_type>::value,
  9963.        "constructed with null function pointer deleter"); }
  9964.       explicit
  9965.       unique_ptr(pointer __p) noexcept
  9966.       : _M_t(__p, deleter_type())
  9967.       { static_assert(!std::is_pointer<deleter_type>::value,
  9968.        "constructed with null function pointer deleter"); }
  9969.       unique_ptr(pointer __p,
  9970.    typename std::conditional<std::is_reference<deleter_type>::value,
  9971.      deleter_type, const deleter_type&>::type __d) noexcept
  9972.       : _M_t(__p, __d) { }
  9973.       unique_ptr(pointer __p,
  9974.    typename std::remove_reference<deleter_type>::type&& __d) noexcept
  9975.       : _M_t(std::move(__p), std::move(__d))
  9976.       { static_assert(!std::is_reference<deleter_type>::value,
  9977.         "rvalue deleter bound to reference"); }
  9978.       constexpr unique_ptr(nullptr_t) noexcept
  9979.       : _M_t()
  9980.       { static_assert(!std::is_pointer<deleter_type>::value,
  9981.        "constructed with null function pointer deleter"); }
  9982.       unique_ptr(unique_ptr&& __u) noexcept
  9983.       : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter())) { }
  9984.       template<typename _Up, typename _Ep, typename = typename
  9985.  std::enable_if
  9986.    <std::is_convertible<typename unique_ptr<_Up, _Ep>::pointer,
  9987.           pointer>::value
  9988.     && !std::is_array<_Up>::value
  9989.     && ((std::is_reference<_Dp>::value
  9990.   && std::is_same<_Ep, _Dp>::value)
  9991.         || (!std::is_reference<_Dp>::value
  9992.      && std::is_convertible<_Ep, _Dp>::value))>
  9993.       ::type>
  9994.  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  9995.  : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter()))
  9996.  { }
  9997.       template<typename _Up, typename = typename
  9998.  std::enable_if<std::is_convertible<_Up*, _Tp*>::value
  9999.          && std::is_same<_Dp,
  10000.            default_delete<_Tp>>::value>::type>
  10001.  unique_ptr(auto_ptr<_Up>&& __u) noexcept
  10002.  : _M_t(__u.release(), deleter_type()) { }
  10003.       ~unique_ptr() noexcept
  10004.       {
  10005.  auto& __ptr = std::get<0>(_M_t);
  10006.  if (__ptr != nullptr)
  10007.    get_deleter()(__ptr);
  10008.  __ptr = pointer();
  10009.       }
  10010.       unique_ptr&
  10011.       operator=(unique_ptr&& __u) noexcept
  10012.       {
  10013.  reset(__u.release());
  10014.  get_deleter() = std::forward<deleter_type>(__u.get_deleter());
  10015.  return *this;
  10016.       }
  10017.       template<typename _Up, typename _Ep, typename = typename
  10018.  std::enable_if
  10019.    <std::is_convertible<typename unique_ptr<_Up, _Ep>::pointer,
  10020.           pointer>::value
  10021.     && !std::is_array<_Up>::value>::type>
  10022.  unique_ptr&
  10023.  operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
  10024.  {
  10025.    reset(__u.release());
  10026.    get_deleter() = std::forward<_Ep>(__u.get_deleter());
  10027.    return *this;
  10028.  }
  10029.       unique_ptr&
  10030.       operator=(nullptr_t) noexcept
  10031.       {
  10032.  reset();
  10033.  return *this;
  10034.       }
  10035.       typename std::add_lvalue_reference<element_type>::type
  10036.       operator*() const
  10037.       {
  10038.  ;
  10039.  return *get();
  10040.       }
  10041.       pointer
  10042.       operator->() const noexcept
  10043.       {
  10044.  ;
  10045.  return get();
  10046.       }
  10047.       pointer
  10048.       get() const noexcept
  10049.       { return std::get<0>(_M_t); }
  10050.       deleter_type&
  10051.       get_deleter() noexcept
  10052.       { return std::get<1>(_M_t); }
  10053.       const deleter_type&
  10054.       get_deleter() const noexcept
  10055.       { return std::get<1>(_M_t); }
  10056.       explicit operator bool() const noexcept
  10057.       { return get() == pointer() ? false : true; }
  10058.       pointer
  10059.       release() noexcept
  10060.       {
  10061.  pointer __p = get();
  10062.  std::get<0>(_M_t) = pointer();
  10063.  return __p;
  10064.       }
  10065.       void
  10066.       reset(pointer __p = pointer()) noexcept
  10067.       {
  10068.  using std::swap;
  10069.  swap(std::get<0>(_M_t), __p);
  10070.  if (__p != pointer())
  10071.    get_deleter()(__p);
  10072.       }
  10073.       void
  10074.       swap(unique_ptr& __u) noexcept
  10075.       {
  10076.  using std::swap;
  10077.  swap(_M_t, __u._M_t);
  10078.       }
  10079.       unique_ptr(const unique_ptr&) = delete;
  10080.       unique_ptr& operator=(const unique_ptr&) = delete;
  10081.   };
  10082.   template<typename _Tp, typename _Dp>
  10083.     class unique_ptr<_Tp[], _Dp>
  10084.     {
  10085.       typedef std::tuple<_Tp*, _Dp> __tuple_type;
  10086.       __tuple_type _M_t;
  10087.     public:
  10088.       typedef _Tp* pointer;
  10089.       typedef _Tp element_type;
  10090.       typedef _Dp deleter_type;
  10091.       constexpr unique_ptr() noexcept
  10092.       : _M_t()
  10093.       { static_assert(!std::is_pointer<deleter_type>::value,
  10094.        "constructed with null function pointer deleter"); }
  10095.       explicit
  10096.       unique_ptr(pointer __p) noexcept
  10097.       : _M_t(__p, deleter_type())
  10098.       { static_assert(!std::is_pointer<deleter_type>::value,
  10099.        "constructed with null function pointer deleter"); }
  10100.       unique_ptr(pointer __p,
  10101.    typename std::conditional<std::is_reference<deleter_type>::value,
  10102.        deleter_type, const deleter_type&>::type __d) noexcept
  10103.       : _M_t(__p, __d) { }
  10104.       unique_ptr(pointer __p, typename
  10105.    std::remove_reference<deleter_type>::type && __d) noexcept
  10106.       : _M_t(std::move(__p), std::move(__d))
  10107.       { static_assert(!std::is_reference<deleter_type>::value,
  10108.         "rvalue deleter bound to reference"); }
  10109.       constexpr unique_ptr(nullptr_t) noexcept
  10110.       : _M_t()
  10111.       { static_assert(!std::is_pointer<deleter_type>::value,
  10112.        "constructed with null function pointer deleter"); }
  10113.       unique_ptr(unique_ptr&& __u) noexcept
  10114.       : _M_t(__u.release(), std::forward<deleter_type>(__u.get_deleter())) { }
  10115.       template<typename _Up, typename _Ep>
  10116.  unique_ptr(unique_ptr<_Up, _Ep>&& __u) noexcept
  10117.  : _M_t(__u.release(), std::forward<_Ep>(__u.get_deleter()))
  10118.  { }
  10119.       ~unique_ptr()
  10120.       {
  10121.  auto& __ptr = std::get<0>(_M_t);
  10122.  if (__ptr != nullptr)
  10123.    get_deleter()(__ptr);
  10124.  __ptr = pointer();
  10125.       }
  10126.       unique_ptr&
  10127.       operator=(unique_ptr&& __u) noexcept
  10128.       {
  10129.  reset(__u.release());
  10130.  get_deleter() = std::forward<deleter_type>(__u.get_deleter());
  10131.  return *this;
  10132.       }
  10133.       template<typename _Up, typename _Ep>
  10134.  unique_ptr&
  10135.  operator=(unique_ptr<_Up, _Ep>&& __u) noexcept
  10136.  {
  10137.    reset(__u.release());
  10138.    get_deleter() = std::forward<_Ep>(__u.get_deleter());
  10139.    return *this;
  10140.  }
  10141.       unique_ptr&
  10142.       operator=(nullptr_t) noexcept
  10143.       {
  10144.  reset();
  10145.  return *this;
  10146.       }
  10147.       typename std::add_lvalue_reference<element_type>::type
  10148.       operator[](size_t __i) const
  10149.       {
  10150.  ;
  10151.  return get()[__i];
  10152.       }
  10153.       pointer
  10154.       get() const noexcept
  10155.       { return std::get<0>(_M_t); }
  10156.       deleter_type&
  10157.       get_deleter() noexcept
  10158.       { return std::get<1>(_M_t); }
  10159.       const deleter_type&
  10160.       get_deleter() const noexcept
  10161.       { return std::get<1>(_M_t); }
  10162.       explicit operator bool() const noexcept
  10163.       { return get() == pointer() ? false : true; }
  10164.       pointer
  10165.       release() noexcept
  10166.       {
  10167.  pointer __p = get();
  10168.  std::get<0>(_M_t) = pointer();
  10169.  return __p;
  10170.       }
  10171.       void
  10172.       reset(pointer __p = pointer()) noexcept
  10173.       {
  10174.  using std::swap;
  10175.  swap(std::get<0>(_M_t), __p);
  10176.  if (__p != nullptr)
  10177.    get_deleter()(__p);
  10178.       }
  10179.       void
  10180.       reset(nullptr_t) noexcept
  10181.       {
  10182.  pointer __p = get();
  10183.  std::get<0>(_M_t) = pointer();
  10184.  if (__p != nullptr)
  10185.    get_deleter()(__p);
  10186.       }
  10187.       template<typename _Up>
  10188.  void reset(_Up) = delete;
  10189.       void
  10190.       swap(unique_ptr& __u) noexcept
  10191.       {
  10192.  using std::swap;
  10193.  swap(_M_t, __u._M_t);
  10194.       }
  10195.       unique_ptr(const unique_ptr&) = delete;
  10196.       unique_ptr& operator=(const unique_ptr&) = delete;
  10197.       template<typename _Up>
  10198.  unique_ptr(_Up*, typename
  10199.      std::conditional<std::is_reference<deleter_type>::value,
  10200.      deleter_type, const deleter_type&>::type,
  10201.      typename std::enable_if<std::is_convertible<_Up*,
  10202.      pointer>::value>::type* = 0) = delete;
  10203.       template<typename _Up>
  10204.  unique_ptr(_Up*, typename std::remove_reference<deleter_type>::type&&,
  10205.      typename std::enable_if<std::is_convertible<_Up*,
  10206.      pointer>::value>::type* = 0) = delete;
  10207.       template<typename _Up>
  10208.  explicit
  10209.  unique_ptr(_Up*, typename std::enable_if<std::is_convertible<_Up*,
  10210.      pointer>::value>::type* = 0) = delete;
  10211.     };
  10212.   template<typename _Tp, typename _Dp>
  10213.     inline void
  10214.     swap(unique_ptr<_Tp, _Dp>& __x,
  10215.   unique_ptr<_Tp, _Dp>& __y) noexcept
  10216.     { __x.swap(__y); }
  10217.   template<typename _Tp, typename _Dp,
  10218.     typename _Up, typename _Ep>
  10219.     inline bool
  10220.     operator==(const unique_ptr<_Tp, _Dp>& __x,
  10221.         const unique_ptr<_Up, _Ep>& __y)
  10222.     { return __x.get() == __y.get(); }
  10223.   template<typename _Tp, typename _Dp>
  10224.     inline bool
  10225.     operator==(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
  10226.     { return !__x; }
  10227.   template<typename _Tp, typename _Dp>
  10228.     inline bool
  10229.     operator==(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
  10230.     { return !__x; }
  10231.   template<typename _Tp, typename _Dp,
  10232.     typename _Up, typename _Ep>
  10233.     inline bool
  10234.     operator!=(const unique_ptr<_Tp, _Dp>& __x,
  10235.         const unique_ptr<_Up, _Ep>& __y)
  10236.     { return __x.get() != __y.get(); }
  10237.   template<typename _Tp, typename _Dp>
  10238.     inline bool
  10239.     operator!=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t) noexcept
  10240.     { return (bool)__x; }
  10241.   template<typename _Tp, typename _Dp>
  10242.     inline bool
  10243.     operator!=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x) noexcept
  10244.     { return (bool)__x; }
  10245.   template<typename _Tp, typename _Dp,
  10246.     typename _Up, typename _Ep>
  10247.     inline bool
  10248.     operator<(const unique_ptr<_Tp, _Dp>& __x,
  10249.        const unique_ptr<_Up, _Ep>& __y)
  10250.     {
  10251.       typedef typename
  10252.  std::common_type<typename unique_ptr<_Tp, _Dp>::pointer,
  10253.                   typename unique_ptr<_Up, _Ep>::pointer>::type _CT;
  10254.       return std::less<_CT>()(__x.get(), __y.get());
  10255.     }
  10256.   template<typename _Tp, typename _Dp>
  10257.     inline bool
  10258.     operator<(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
  10259.     { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
  10260.          nullptr); }
  10261.   template<typename _Tp, typename _Dp>
  10262.     inline bool
  10263.     operator<(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
  10264.     { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
  10265.          __x.get()); }
  10266.   template<typename _Tp, typename _Dp,
  10267.     typename _Up, typename _Ep>
  10268.     inline bool
  10269.     operator<=(const unique_ptr<_Tp, _Dp>& __x,
  10270.         const unique_ptr<_Up, _Ep>& __y)
  10271.     { return !(__y < __x); }
  10272.   template<typename _Tp, typename _Dp>
  10273.     inline bool
  10274.     operator<=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
  10275.     { return !(nullptr < __x); }
  10276.   template<typename _Tp, typename _Dp>
  10277.     inline bool
  10278.     operator<=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
  10279.     { return !(__x < nullptr); }
  10280.   template<typename _Tp, typename _Dp,
  10281.     typename _Up, typename _Ep>
  10282.     inline bool
  10283.     operator>(const unique_ptr<_Tp, _Dp>& __x,
  10284.        const unique_ptr<_Up, _Ep>& __y)
  10285.     { return (__y < __x); }
  10286.   template<typename _Tp, typename _Dp>
  10287.     inline bool
  10288.     operator>(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
  10289.     { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(nullptr,
  10290.          __x.get()); }
  10291.   template<typename _Tp, typename _Dp>
  10292.     inline bool
  10293.     operator>(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
  10294.     { return std::less<typename unique_ptr<_Tp, _Dp>::pointer>()(__x.get(),
  10295.          nullptr); }
  10296.   template<typename _Tp, typename _Dp,
  10297.     typename _Up, typename _Ep>
  10298.     inline bool
  10299.     operator>=(const unique_ptr<_Tp, _Dp>& __x,
  10300.         const unique_ptr<_Up, _Ep>& __y)
  10301.     { return !(__x < __y); }
  10302.   template<typename _Tp, typename _Dp>
  10303.     inline bool
  10304.     operator>=(const unique_ptr<_Tp, _Dp>& __x, nullptr_t)
  10305.     { return !(__x < nullptr); }
  10306.   template<typename _Tp, typename _Dp>
  10307.     inline bool
  10308.     operator>=(nullptr_t, const unique_ptr<_Tp, _Dp>& __x)
  10309.     { return !(nullptr < __x); }
  10310.   template<typename _Tp, typename _Dp>
  10311.     struct hash<unique_ptr<_Tp, _Dp>>
  10312.     : public __hash_base<size_t, unique_ptr<_Tp, _Dp>>
  10313.     {
  10314.       size_t
  10315.       operator()(const unique_ptr<_Tp, _Dp>& __u) const noexcept
  10316.       {
  10317.  typedef unique_ptr<_Tp, _Dp> _UP;
  10318.  return std::hash<typename _UP::pointer>()(__u.get());
  10319.       }
  10320.     };
  10321.  
  10322. }
  10323. namespace std __attribute__ ((__visibility__ ("default")))
  10324. {
  10325.  
  10326.   class bad_weak_ptr : public std::exception
  10327.   {
  10328.   public:
  10329.     virtual char const*
  10330.     what() const noexcept;
  10331.     virtual ~bad_weak_ptr() noexcept;
  10332.   };
  10333.   inline void
  10334.   __throw_bad_weak_ptr()
  10335.   {
  10336.     throw bad_weak_ptr();
  10337.   }
  10338.   using __gnu_cxx::_Lock_policy;
  10339.   using __gnu_cxx::__default_lock_policy;
  10340.   using __gnu_cxx::_S_single;
  10341.   using __gnu_cxx::_S_mutex;
  10342.   using __gnu_cxx::_S_atomic;
  10343.   template<_Lock_policy _Lp>
  10344.     class _Mutex_base
  10345.     {
  10346.     protected:
  10347.       enum { _S_need_barriers = 0 };
  10348.     };
  10349.   template<>
  10350.     class _Mutex_base<_S_mutex>
  10351.     : public __gnu_cxx::__mutex
  10352.     {
  10353.     protected:
  10354.       enum { _S_need_barriers = 1 };
  10355.     };
  10356.   template<_Lock_policy _Lp = __default_lock_policy>
  10357.     class _Sp_counted_base
  10358.     : public _Mutex_base<_Lp>
  10359.     {
  10360.     public:
  10361.       _Sp_counted_base() noexcept
  10362.       : _M_use_count(1), _M_weak_count(1) { }
  10363.       virtual
  10364.       ~_Sp_counted_base() noexcept
  10365.       { }
  10366.       virtual void
  10367.       _M_dispose() noexcept = 0;
  10368.       virtual void
  10369.       _M_destroy() noexcept
  10370.       { delete this; }
  10371.       virtual void*
  10372.       _M_get_deleter(const std::type_info&) = 0;
  10373.       void
  10374.       _M_add_ref_copy()
  10375.       { __gnu_cxx::__atomic_add_dispatch(&_M_use_count, 1); }
  10376.       void
  10377.       _M_add_ref_lock();
  10378.       void
  10379.       _M_release() noexcept
  10380.       {
  10381.         ;
  10382.  if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, -1) == 1)
  10383.    {
  10384.             ;
  10385.      _M_dispose();
  10386.      if (_Mutex_base<_Lp>::_S_need_barriers)
  10387.        {
  10388.          __asm __volatile ("":::"memory");
  10389.          __asm __volatile ("":::"memory");
  10390.        }
  10391.             ;
  10392.      if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count,
  10393.              -1) == 1)
  10394.               {
  10395.                 ;
  10396.          _M_destroy();
  10397.               }
  10398.    }
  10399.       }
  10400.       void
  10401.       _M_weak_add_ref() noexcept
  10402.       { __gnu_cxx::__atomic_add_dispatch(&_M_weak_count, 1); }
  10403.       void
  10404.       _M_weak_release() noexcept
  10405.       {
  10406.         ;
  10407.  if (__gnu_cxx::__exchange_and_add_dispatch(&_M_weak_count, -1) == 1)
  10408.    {
  10409.             ;
  10410.      if (_Mutex_base<_Lp>::_S_need_barriers)
  10411.        {
  10412.          __asm __volatile ("":::"memory");
  10413.          __asm __volatile ("":::"memory");
  10414.        }
  10415.      _M_destroy();
  10416.    }
  10417.       }
  10418.       long
  10419.       _M_get_use_count() const noexcept
  10420.       {
  10421.         return __atomic_load_n(&_M_use_count, 0);
  10422.       }
  10423.     private:
  10424.       _Sp_counted_base(_Sp_counted_base const&) = delete;
  10425.       _Sp_counted_base& operator=(_Sp_counted_base const&) = delete;
  10426.       _Atomic_word _M_use_count;
  10427.       _Atomic_word _M_weak_count;
  10428.     };
  10429.   template<>
  10430.     inline void
  10431.     _Sp_counted_base<_S_single>::
  10432.     _M_add_ref_lock()
  10433.     {
  10434.       if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
  10435.  {
  10436.    _M_use_count = 0;
  10437.    __throw_bad_weak_ptr();
  10438.  }
  10439.     }
  10440.   template<>
  10441.     inline void
  10442.     _Sp_counted_base<_S_mutex>::
  10443.     _M_add_ref_lock()
  10444.     {
  10445.       __gnu_cxx::__scoped_lock sentry(*this);
  10446.       if (__gnu_cxx::__exchange_and_add_dispatch(&_M_use_count, 1) == 0)
  10447.  {
  10448.    _M_use_count = 0;
  10449.    __throw_bad_weak_ptr();
  10450.  }
  10451.     }
  10452.   template<>
  10453.     inline void
  10454.     _Sp_counted_base<_S_atomic>::
  10455.     _M_add_ref_lock()
  10456.     {
  10457.       _Atomic_word __count = _M_use_count;
  10458.       do
  10459.  {
  10460.    if (__count == 0)
  10461.      __throw_bad_weak_ptr();
  10462.  }
  10463.       while (!__atomic_compare_exchange_n(&_M_use_count, &__count, __count + 1,
  10464.        true, 4,
  10465.        0));
  10466.     }
  10467.   template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
  10468.     class __shared_ptr;
  10469.   template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
  10470.     class __weak_ptr;
  10471.   template<typename _Tp, _Lock_policy _Lp = __default_lock_policy>
  10472.     class __enable_shared_from_this;
  10473.   template<typename _Tp>
  10474.     class shared_ptr;
  10475.   template<typename _Tp>
  10476.     class weak_ptr;
  10477.   template<typename _Tp>
  10478.     struct owner_less;
  10479.   template<typename _Tp>
  10480.     class enable_shared_from_this;
  10481.   template<_Lock_policy _Lp = __default_lock_policy>
  10482.     class __weak_count;
  10483.   template<_Lock_policy _Lp = __default_lock_policy>
  10484.     class __shared_count;
  10485.   template<typename _Ptr, _Lock_policy _Lp>
  10486.     class _Sp_counted_ptr final : public _Sp_counted_base<_Lp>
  10487.     {
  10488.     public:
  10489.       explicit
  10490.       _Sp_counted_ptr(_Ptr __p)
  10491.       : _M_ptr(__p) { }
  10492.       virtual void
  10493.       _M_dispose() noexcept
  10494.       { delete _M_ptr; }
  10495.       virtual void
  10496.       _M_destroy() noexcept
  10497.       { delete this; }
  10498.       virtual void*
  10499.       _M_get_deleter(const std::type_info&)
  10500.       { return 0; }
  10501.       _Sp_counted_ptr(const _Sp_counted_ptr&) = delete;
  10502.       _Sp_counted_ptr& operator=(const _Sp_counted_ptr&) = delete;
  10503.     protected:
  10504.       _Ptr _M_ptr;
  10505.     };
  10506.   template<>
  10507.     inline void
  10508.     _Sp_counted_ptr<nullptr_t, _S_single>::_M_dispose() noexcept { }
  10509.   template<>
  10510.     inline void
  10511.     _Sp_counted_ptr<nullptr_t, _S_mutex>::_M_dispose() noexcept { }
  10512.   template<>
  10513.     inline void
  10514.     _Sp_counted_ptr<nullptr_t, _S_atomic>::_M_dispose() noexcept { }
  10515.   template<typename _Ptr, typename _Deleter, typename _Alloc, _Lock_policy _Lp>
  10516.     class _Sp_counted_deleter final : public _Sp_counted_base<_Lp>
  10517.     {
  10518.       struct _My_Deleter
  10519.       : public _Alloc
  10520.       {
  10521.  _Deleter _M_del;
  10522.  _My_Deleter(_Deleter __d, const _Alloc& __a)
  10523.  : _Alloc(__a), _M_del(__d) { }
  10524.       };
  10525.     public:
  10526.       _Sp_counted_deleter(_Ptr __p, _Deleter __d)
  10527.       : _M_ptr(__p), _M_del(__d, _Alloc()) { }
  10528.       _Sp_counted_deleter(_Ptr __p, _Deleter __d, const _Alloc& __a)
  10529.       : _M_ptr(__p), _M_del(__d, __a) { }
  10530.       ~_Sp_counted_deleter() noexcept { }
  10531.       virtual void
  10532.       _M_dispose() noexcept
  10533.       { _M_del._M_del(_M_ptr); }
  10534.       virtual void
  10535.       _M_destroy() noexcept
  10536.       {
  10537.  typedef typename allocator_traits<_Alloc>::template
  10538.    rebind_traits<_Sp_counted_deleter> _Alloc_traits;
  10539.  typename _Alloc_traits::allocator_type __a(_M_del);
  10540.  _Alloc_traits::destroy(__a, this);
  10541.  _Alloc_traits::deallocate(__a, this, 1);
  10542.       }
  10543.       virtual void*
  10544.       _M_get_deleter(const std::type_info& __ti)
  10545.       {
  10546.         return __ti == typeid(_Deleter) ? &_M_del._M_del : 0;
  10547.       }
  10548.     protected:
  10549.       _Ptr _M_ptr;
  10550.       _My_Deleter _M_del;
  10551.     };
  10552.   struct _Sp_make_shared_tag { };
  10553.   template<typename _Tp, typename _Alloc, _Lock_policy _Lp>
  10554.     class _Sp_counted_ptr_inplace final : public _Sp_counted_base<_Lp>
  10555.     {
  10556.       struct _Impl
  10557.       : public _Alloc
  10558.       {
  10559.  _Impl(_Alloc __a) : _Alloc(__a), _M_ptr() { }
  10560.  _Tp* _M_ptr;
  10561.       };
  10562.     public:
  10563.       template<typename... _Args>
  10564.  _Sp_counted_ptr_inplace(_Alloc __a, _Args&&... __args)
  10565.  : _M_impl(__a), _M_storage()
  10566.  {
  10567.    _M_impl._M_ptr = static_cast<_Tp*>(static_cast<void*>(&_M_storage));
  10568.    allocator_traits<_Alloc>::construct(__a, _M_impl._M_ptr,
  10569.        std::forward<_Args>(__args)...);
  10570.  }
  10571.       ~_Sp_counted_ptr_inplace() noexcept { }
  10572.       virtual void
  10573.       _M_dispose() noexcept
  10574.       { allocator_traits<_Alloc>::destroy(_M_impl, _M_impl._M_ptr); }
  10575.       virtual void
  10576.       _M_destroy() noexcept
  10577.       {
  10578.  typedef typename allocator_traits<_Alloc>::template
  10579.    rebind_traits<_Sp_counted_ptr_inplace> _Alloc_traits;
  10580.  typename _Alloc_traits::allocator_type __a(_M_impl);
  10581.  _Alloc_traits::destroy(__a, this);
  10582.  _Alloc_traits::deallocate(__a, this, 1);
  10583.       }
  10584.       virtual void*
  10585.       _M_get_deleter(const std::type_info& __ti) noexcept
  10586.       {
  10587.  return __ti == typeid(_Sp_make_shared_tag)
  10588.         ? static_cast<void*>(&_M_storage)
  10589.         : 0;
  10590.       }
  10591.     private:
  10592.       _Impl _M_impl;
  10593.       typename aligned_storage<sizeof(_Tp), alignment_of<_Tp>::value>::type
  10594.  _M_storage;
  10595.     };
  10596.   template<_Lock_policy _Lp>
  10597.     class __shared_count
  10598.     {
  10599.     public:
  10600.       constexpr __shared_count() noexcept : _M_pi(0)
  10601.       { }
  10602.       template<typename _Ptr>
  10603.         explicit
  10604.  __shared_count(_Ptr __p) : _M_pi(0)
  10605.  {
  10606.    try
  10607.      {
  10608.        _M_pi = new _Sp_counted_ptr<_Ptr, _Lp>(__p);
  10609.      }
  10610.    catch(...)
  10611.      {
  10612.        delete __p;
  10613.        throw;
  10614.      }
  10615.  }
  10616.       template<typename _Ptr, typename _Deleter>
  10617.  __shared_count(_Ptr __p, _Deleter __d) : _M_pi(0)
  10618.  {
  10619.    typedef std::allocator<int> _Alloc;
  10620.    typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
  10621.    typedef typename allocator_traits<_Alloc>::template
  10622.      rebind_traits<_Sp_cd_type> _Alloc_traits;
  10623.    typename _Alloc_traits::allocator_type __a;
  10624.    _Sp_cd_type* __mem = 0;
  10625.    try
  10626.      {
  10627.        __mem = _Alloc_traits::allocate(__a, 1);
  10628.        _Alloc_traits::construct(__a, __mem, __p, std::move(__d));
  10629.        _M_pi = __mem;
  10630.      }
  10631.    catch(...)
  10632.      {
  10633.        __d(__p);
  10634.        if (__mem)
  10635.          _Alloc_traits::deallocate(__a, __mem, 1);
  10636.        throw;
  10637.      }
  10638.  }
  10639.       template<typename _Ptr, typename _Deleter, typename _Alloc>
  10640.  __shared_count(_Ptr __p, _Deleter __d, _Alloc __a) : _M_pi(0)
  10641.  {
  10642.    typedef _Sp_counted_deleter<_Ptr, _Deleter, _Alloc, _Lp> _Sp_cd_type;
  10643.    typedef typename allocator_traits<_Alloc>::template
  10644.      rebind_traits<_Sp_cd_type> _Alloc_traits;
  10645.    typename _Alloc_traits::allocator_type __a2(__a);
  10646.    _Sp_cd_type* __mem = 0;
  10647.    try
  10648.      {
  10649.        __mem = _Alloc_traits::allocate(__a2, 1);
  10650.        _Alloc_traits::construct(__a2, __mem,
  10651.     __p, std::move(__d), std::move(__a));
  10652.        _M_pi = __mem;
  10653.      }
  10654.    catch(...)
  10655.      {
  10656.        __d(__p);
  10657.        if (__mem)
  10658.          _Alloc_traits::deallocate(__a2, __mem, 1);
  10659.        throw;
  10660.      }
  10661.  }
  10662.       template<typename _Tp, typename _Alloc, typename... _Args>
  10663.  __shared_count(_Sp_make_shared_tag, _Tp*, const _Alloc& __a,
  10664.          _Args&&... __args)
  10665.  : _M_pi(0)
  10666.  {
  10667.    typedef _Sp_counted_ptr_inplace<_Tp, _Alloc, _Lp> _Sp_cp_type;
  10668.    typedef typename allocator_traits<_Alloc>::template
  10669.      rebind_traits<_Sp_cp_type> _Alloc_traits;
  10670.    typename _Alloc_traits::allocator_type __a2(__a);
  10671.    _Sp_cp_type* __mem = _Alloc_traits::allocate(__a2, 1);
  10672.    try
  10673.      {
  10674.        _Alloc_traits::construct(__a2, __mem, std::move(__a),
  10675.       std::forward<_Args>(__args)...);
  10676.        _M_pi = __mem;
  10677.      }
  10678.    catch(...)
  10679.      {
  10680.        _Alloc_traits::deallocate(__a2, __mem, 1);
  10681.        throw;
  10682.      }
  10683.  }
  10684.       template<typename _Tp>
  10685.         explicit
  10686.  __shared_count(std::auto_ptr<_Tp>&& __r)
  10687.  : _M_pi(new _Sp_counted_ptr<_Tp*, _Lp>(__r.get()))
  10688.  { __r.release(); }
  10689.       template<typename _Tp, typename _Del>
  10690.         explicit
  10691.  __shared_count(std::unique_ptr<_Tp, _Del>&& __r)
  10692.  : _M_pi(_S_create_from_up(std::move(__r)))
  10693.  { __r.release(); }
  10694.       explicit __shared_count(const __weak_count<_Lp>& __r);
  10695.       ~__shared_count() noexcept
  10696.       {
  10697.  if (_M_pi != 0)
  10698.    _M_pi->_M_release();
  10699.       }
  10700.       __shared_count(const __shared_count& __r) noexcept
  10701.       : _M_pi(__r._M_pi)
  10702.       {
  10703.  if (_M_pi != 0)
  10704.    _M_pi->_M_add_ref_copy();
  10705.       }
  10706.       __shared_count&
  10707.       operator=(const __shared_count& __r) noexcept
  10708.       {
  10709.  _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
  10710.  if (__tmp != _M_pi)
  10711.    {
  10712.      if (__tmp != 0)
  10713.        __tmp->_M_add_ref_copy();
  10714.      if (_M_pi != 0)
  10715.        _M_pi->_M_release();
  10716.      _M_pi = __tmp;
  10717.    }
  10718.  return *this;
  10719.       }
  10720.       void
  10721.       _M_swap(__shared_count& __r) noexcept
  10722.       {
  10723.  _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
  10724.  __r._M_pi = _M_pi;
  10725.  _M_pi = __tmp;
  10726.       }
  10727.       long
  10728.       _M_get_use_count() const noexcept
  10729.       { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
  10730.       bool
  10731.       _M_unique() const noexcept
  10732.       { return this->_M_get_use_count() == 1; }
  10733.       void*
  10734.       _M_get_deleter(const std::type_info& __ti) const noexcept
  10735.       { return _M_pi ? _M_pi->_M_get_deleter(__ti) : 0; }
  10736.       bool
  10737.       _M_less(const __shared_count& __rhs) const noexcept
  10738.       { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
  10739.       bool
  10740.       _M_less(const __weak_count<_Lp>& __rhs) const noexcept
  10741.       { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
  10742.       friend inline bool
  10743.       operator==(const __shared_count& __a, const __shared_count& __b) noexcept
  10744.       { return __a._M_pi == __b._M_pi; }
  10745.     private:
  10746.       friend class __weak_count<_Lp>;
  10747.       template<typename _Tp, typename _Del>
  10748.  static _Sp_counted_base<_Lp>*
  10749.  _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
  10750.    typename std::enable_if<!std::is_reference<_Del>::value>::type* = 0)
  10751.  {
  10752.    return new _Sp_counted_deleter<_Tp*, _Del, std::allocator<_Tp>,
  10753.      _Lp>(__r.get(), __r.get_deleter());
  10754.  }
  10755.       template<typename _Tp, typename _Del>
  10756.  static _Sp_counted_base<_Lp>*
  10757.  _S_create_from_up(std::unique_ptr<_Tp, _Del>&& __r,
  10758.    typename std::enable_if<std::is_reference<_Del>::value>::type* = 0)
  10759.  {
  10760.    typedef typename std::remove_reference<_Del>::type _Del1;
  10761.    typedef std::reference_wrapper<_Del1> _Del2;
  10762.    return new _Sp_counted_deleter<_Tp*, _Del2, std::allocator<_Tp>,
  10763.      _Lp>(__r.get(), std::ref(__r.get_deleter()));
  10764.  }
  10765.       _Sp_counted_base<_Lp>* _M_pi;
  10766.     };
  10767.   template<_Lock_policy _Lp>
  10768.     class __weak_count
  10769.     {
  10770.     public:
  10771.       constexpr __weak_count() noexcept : _M_pi(0)
  10772.       { }
  10773.       __weak_count(const __shared_count<_Lp>& __r) noexcept
  10774.       : _M_pi(__r._M_pi)
  10775.       {
  10776.  if (_M_pi != 0)
  10777.    _M_pi->_M_weak_add_ref();
  10778.       }
  10779.       __weak_count(const __weak_count<_Lp>& __r) noexcept
  10780.       : _M_pi(__r._M_pi)
  10781.       {
  10782.  if (_M_pi != 0)
  10783.    _M_pi->_M_weak_add_ref();
  10784.       }
  10785.       ~__weak_count() noexcept
  10786.       {
  10787.  if (_M_pi != 0)
  10788.    _M_pi->_M_weak_release();
  10789.       }
  10790.       __weak_count<_Lp>&
  10791.       operator=(const __shared_count<_Lp>& __r) noexcept
  10792.       {
  10793.  _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
  10794.  if (__tmp != 0)
  10795.    __tmp->_M_weak_add_ref();
  10796.  if (_M_pi != 0)
  10797.    _M_pi->_M_weak_release();
  10798.  _M_pi = __tmp;
  10799.  return *this;
  10800.       }
  10801.       __weak_count<_Lp>&
  10802.       operator=(const __weak_count<_Lp>& __r) noexcept
  10803.       {
  10804.  _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
  10805.  if (__tmp != 0)
  10806.    __tmp->_M_weak_add_ref();
  10807.  if (_M_pi != 0)
  10808.    _M_pi->_M_weak_release();
  10809.  _M_pi = __tmp;
  10810.  return *this;
  10811.       }
  10812.       void
  10813.       _M_swap(__weak_count<_Lp>& __r) noexcept
  10814.       {
  10815.  _Sp_counted_base<_Lp>* __tmp = __r._M_pi;
  10816.  __r._M_pi = _M_pi;
  10817.  _M_pi = __tmp;
  10818.       }
  10819.       long
  10820.       _M_get_use_count() const noexcept
  10821.       { return _M_pi != 0 ? _M_pi->_M_get_use_count() : 0; }
  10822.       bool
  10823.       _M_less(const __weak_count& __rhs) const noexcept
  10824.       { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
  10825.       bool
  10826.       _M_less(const __shared_count<_Lp>& __rhs) const noexcept
  10827.       { return std::less<_Sp_counted_base<_Lp>*>()(this->_M_pi, __rhs._M_pi); }
  10828.       friend inline bool
  10829.       operator==(const __weak_count& __a, const __weak_count& __b) noexcept
  10830.       { return __a._M_pi == __b._M_pi; }
  10831.     private:
  10832.       friend class __shared_count<_Lp>;
  10833.       _Sp_counted_base<_Lp>* _M_pi;
  10834.     };
  10835.   template<_Lock_policy _Lp>
  10836.     inline __shared_count<_Lp>:: __shared_count(const __weak_count<_Lp>& __r)
  10837.     : _M_pi(__r._M_pi)
  10838.     {
  10839.       if (_M_pi != 0)
  10840.  _M_pi->_M_add_ref_lock();
  10841.       else
  10842.  __throw_bad_weak_ptr();
  10843.     }
  10844.   template<_Lock_policy _Lp, typename _Tp1, typename _Tp2>
  10845.     void
  10846.     __enable_shared_from_this_helper(const __shared_count<_Lp>&,
  10847.          const __enable_shared_from_this<_Tp1,
  10848.          _Lp>*, const _Tp2*) noexcept;
  10849.   template<typename _Tp1, typename _Tp2>
  10850.     void
  10851.     __enable_shared_from_this_helper(const __shared_count<>&,
  10852.          const enable_shared_from_this<_Tp1>*,
  10853.          const _Tp2*) noexcept;
  10854.   template<_Lock_policy _Lp>
  10855.     inline void
  10856.     __enable_shared_from_this_helper(const __shared_count<_Lp>&, ...) noexcept
  10857.     { }
  10858.   template<typename _Tp, _Lock_policy _Lp>
  10859.     class __shared_ptr
  10860.     {
  10861.     public:
  10862.       typedef _Tp element_type;
  10863.       constexpr __shared_ptr() noexcept
  10864.       : _M_ptr(0), _M_refcount()
  10865.       { }
  10866.       template<typename _Tp1>
  10867.  explicit __shared_ptr(_Tp1* __p)
  10868.         : _M_ptr(__p), _M_refcount(__p)
  10869.  {
  10870.  
  10871.    static_assert( sizeof(_Tp1) > 0, "incomplete type" );
  10872.    __enable_shared_from_this_helper(_M_refcount, __p, __p);
  10873.  }
  10874.       template<typename _Tp1, typename _Deleter>
  10875.  __shared_ptr(_Tp1* __p, _Deleter __d)
  10876.  : _M_ptr(__p), _M_refcount(__p, __d)
  10877.  {
  10878.  
  10879.    __enable_shared_from_this_helper(_M_refcount, __p, __p);
  10880.  }
  10881.       template<typename _Tp1, typename _Deleter, typename _Alloc>
  10882.  __shared_ptr(_Tp1* __p, _Deleter __d, _Alloc __a)
  10883.  : _M_ptr(__p), _M_refcount(__p, __d, std::move(__a))
  10884.  {
  10885.  
  10886.    __enable_shared_from_this_helper(_M_refcount, __p, __p);
  10887.  }
  10888.       template<typename _Deleter>
  10889.  __shared_ptr(nullptr_t __p, _Deleter __d)
  10890.  : _M_ptr(0), _M_refcount(__p, __d)
  10891.  { }
  10892.       template<typename _Deleter, typename _Alloc>
  10893.         __shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
  10894.  : _M_ptr(0), _M_refcount(__p, __d, std::move(__a))
  10895.  { }
  10896.       template<typename _Tp1>
  10897.  __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r, _Tp* __p) noexcept
  10898.  : _M_ptr(__p), _M_refcount(__r._M_refcount)
  10899.  { }
  10900.       __shared_ptr(const __shared_ptr&) noexcept = default;
  10901.       __shared_ptr& operator=(const __shared_ptr&) noexcept = default;
  10902.       ~__shared_ptr() = default;
  10903.       template<typename _Tp1, typename = typename
  10904.         std::enable_if<std::is_convertible<_Tp1*, _Tp*>::value>::type>
  10905.  __shared_ptr(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
  10906.  : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount)
  10907.  { }
  10908.       __shared_ptr(__shared_ptr&& __r) noexcept
  10909.       : _M_ptr(__r._M_ptr), _M_refcount()
  10910.       {
  10911.  _M_refcount._M_swap(__r._M_refcount);
  10912.  __r._M_ptr = 0;
  10913.       }
  10914.       template<typename _Tp1, typename = typename
  10915.         std::enable_if<std::is_convertible<_Tp1*, _Tp*>::value>::type>
  10916.  __shared_ptr(__shared_ptr<_Tp1, _Lp>&& __r) noexcept
  10917.  : _M_ptr(__r._M_ptr), _M_refcount()
  10918.  {
  10919.    _M_refcount._M_swap(__r._M_refcount);
  10920.    __r._M_ptr = 0;
  10921.  }
  10922.       template<typename _Tp1>
  10923.  explicit __shared_ptr(const __weak_ptr<_Tp1, _Lp>& __r)
  10924.  : _M_refcount(__r._M_refcount)
  10925.  {
  10926.  
  10927.    _M_ptr = __r._M_ptr;
  10928.  }
  10929.       template<typename _Tp1, typename _Del>
  10930.  __shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
  10931.  : _M_ptr(__r.get()), _M_refcount()
  10932.  {
  10933.  
  10934.    _Tp1* __tmp = __r.get();
  10935.    _M_refcount = __shared_count<_Lp>(std::move(__r));
  10936.    __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
  10937.  }
  10938.       template<typename _Tp1>
  10939.  __shared_ptr(std::auto_ptr<_Tp1>&& __r)
  10940.  : _M_ptr(__r.get()), _M_refcount()
  10941.  {
  10942.  
  10943.    static_assert( sizeof(_Tp1) > 0, "incomplete type" );
  10944.    _Tp1* __tmp = __r.get();
  10945.    _M_refcount = __shared_count<_Lp>(std::move(__r));
  10946.    __enable_shared_from_this_helper(_M_refcount, __tmp, __tmp);
  10947.  }
  10948.       constexpr __shared_ptr(nullptr_t) noexcept
  10949.       : _M_ptr(0), _M_refcount()
  10950.       { }
  10951.       template<typename _Tp1>
  10952.  __shared_ptr&
  10953.  operator=(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
  10954.  {
  10955.    _M_ptr = __r._M_ptr;
  10956.    _M_refcount = __r._M_refcount;
  10957.    return *this;
  10958.  }
  10959.       template<typename _Tp1>
  10960.  __shared_ptr&
  10961.  operator=(std::auto_ptr<_Tp1>&& __r)
  10962.  {
  10963.    __shared_ptr(std::move(__r)).swap(*this);
  10964.    return *this;
  10965.  }
  10966.       __shared_ptr&
  10967.       operator=(__shared_ptr&& __r) noexcept
  10968.       {
  10969.  __shared_ptr(std::move(__r)).swap(*this);
  10970.  return *this;
  10971.       }
  10972.       template<class _Tp1>
  10973.  __shared_ptr&
  10974.  operator=(__shared_ptr<_Tp1, _Lp>&& __r) noexcept
  10975.  {
  10976.    __shared_ptr(std::move(__r)).swap(*this);
  10977.    return *this;
  10978.  }
  10979.       template<typename _Tp1, typename _Del>
  10980.  __shared_ptr&
  10981.  operator=(std::unique_ptr<_Tp1, _Del>&& __r)
  10982.  {
  10983.    __shared_ptr(std::move(__r)).swap(*this);
  10984.    return *this;
  10985.  }
  10986.       void
  10987.       reset() noexcept
  10988.       { __shared_ptr().swap(*this); }
  10989.       template<typename _Tp1>
  10990.  void
  10991.  reset(_Tp1* __p)
  10992.  {
  10993.    ;
  10994.    __shared_ptr(__p).swap(*this);
  10995.  }
  10996.       template<typename _Tp1, typename _Deleter>
  10997.  void
  10998.  reset(_Tp1* __p, _Deleter __d)
  10999.  { __shared_ptr(__p, __d).swap(*this); }
  11000.       template<typename _Tp1, typename _Deleter, typename _Alloc>
  11001.  void
  11002.         reset(_Tp1* __p, _Deleter __d, _Alloc __a)
  11003.         { __shared_ptr(__p, __d, std::move(__a)).swap(*this); }
  11004.       typename std::add_lvalue_reference<_Tp>::type
  11005.       operator*() const noexcept
  11006.       {
  11007.  ;
  11008.  return *_M_ptr;
  11009.       }
  11010.       _Tp*
  11011.       operator->() const noexcept
  11012.       {
  11013.  ;
  11014.  return _M_ptr;
  11015.       }
  11016.       _Tp*
  11017.       get() const noexcept
  11018.       { return _M_ptr; }
  11019.       explicit operator bool() const
  11020.       { return _M_ptr == 0 ? false : true; }
  11021.       bool
  11022.       unique() const noexcept
  11023.       { return _M_refcount._M_unique(); }
  11024.       long
  11025.       use_count() const noexcept
  11026.       { return _M_refcount._M_get_use_count(); }
  11027.       void
  11028.       swap(__shared_ptr<_Tp, _Lp>& __other) noexcept
  11029.       {
  11030.  std::swap(_M_ptr, __other._M_ptr);
  11031.  _M_refcount._M_swap(__other._M_refcount);
  11032.       }
  11033.       template<typename _Tp1>
  11034.  bool
  11035.  owner_before(__shared_ptr<_Tp1, _Lp> const& __rhs) const
  11036.  { return _M_refcount._M_less(__rhs._M_refcount); }
  11037.       template<typename _Tp1>
  11038.  bool
  11039.  owner_before(__weak_ptr<_Tp1, _Lp> const& __rhs) const
  11040.  { return _M_refcount._M_less(__rhs._M_refcount); }
  11041.     protected:
  11042.       template<typename _Alloc, typename... _Args>
  11043.  __shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a,
  11044.        _Args&&... __args)
  11045.  : _M_ptr(), _M_refcount(__tag, (_Tp*)0, __a,
  11046.     std::forward<_Args>(__args)...)
  11047.  {
  11048.    void* __p = _M_refcount._M_get_deleter(typeid(__tag));
  11049.    _M_ptr = static_cast<_Tp*>(__p);
  11050.    __enable_shared_from_this_helper(_M_refcount, _M_ptr, _M_ptr);
  11051.  }
  11052.       template<typename _Tp1, _Lock_policy _Lp1, typename _Alloc,
  11053.         typename... _Args>
  11054.  friend __shared_ptr<_Tp1, _Lp1>
  11055.  __allocate_shared(const _Alloc& __a, _Args&&... __args);
  11056.     private:
  11057.       void*
  11058.       _M_get_deleter(const std::type_info& __ti) const noexcept
  11059.       { return _M_refcount._M_get_deleter(__ti); }
  11060.       template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
  11061.       template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
  11062.       template<typename _Del, typename _Tp1, _Lock_policy _Lp1>
  11063.  friend _Del* get_deleter(const __shared_ptr<_Tp1, _Lp1>&) noexcept;
  11064.       _Tp* _M_ptr;
  11065.       __shared_count<_Lp> _M_refcount;
  11066.     };
  11067.   template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
  11068.     inline bool
  11069.     operator==(const __shared_ptr<_Tp1, _Lp>& __a,
  11070.         const __shared_ptr<_Tp2, _Lp>& __b) noexcept
  11071.     { return __a.get() == __b.get(); }
  11072.   template<typename _Tp, _Lock_policy _Lp>
  11073.     inline bool
  11074.     operator==(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
  11075.     { return !__a; }
  11076.   template<typename _Tp, _Lock_policy _Lp>
  11077.     inline bool
  11078.     operator==(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
  11079.     { return !__a; }
  11080.   template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
  11081.     inline bool
  11082.     operator!=(const __shared_ptr<_Tp1, _Lp>& __a,
  11083.         const __shared_ptr<_Tp2, _Lp>& __b) noexcept
  11084.     { return __a.get() != __b.get(); }
  11085.   template<typename _Tp, _Lock_policy _Lp>
  11086.     inline bool
  11087.     operator!=(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
  11088.     { return (bool)__a; }
  11089.   template<typename _Tp, _Lock_policy _Lp>
  11090.     inline bool
  11091.     operator!=(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
  11092.     { return (bool)__a; }
  11093.   template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
  11094.     inline bool
  11095.     operator<(const __shared_ptr<_Tp1, _Lp>& __a,
  11096.        const __shared_ptr<_Tp2, _Lp>& __b) noexcept
  11097.     {
  11098.       typedef typename std::common_type<_Tp1*, _Tp2*>::type _CT;
  11099.       return std::less<_CT>()(__a.get(), __b.get());
  11100.     }
  11101.   template<typename _Tp, _Lock_policy _Lp>
  11102.     inline bool
  11103.     operator<(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
  11104.     { return std::less<_Tp*>()(__a.get(), nullptr); }
  11105.   template<typename _Tp, _Lock_policy _Lp>
  11106.     inline bool
  11107.     operator<(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
  11108.     { return std::less<_Tp*>()(nullptr, __a.get()); }
  11109.   template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
  11110.     inline bool
  11111.     operator<=(const __shared_ptr<_Tp1, _Lp>& __a,
  11112.         const __shared_ptr<_Tp2, _Lp>& __b) noexcept
  11113.     { return !(__b < __a); }
  11114.   template<typename _Tp, _Lock_policy _Lp>
  11115.     inline bool
  11116.     operator<=(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
  11117.     { return !(nullptr < __a); }
  11118.   template<typename _Tp, _Lock_policy _Lp>
  11119.     inline bool
  11120.     operator<=(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
  11121.     { return !(__a < nullptr); }
  11122.   template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
  11123.     inline bool
  11124.     operator>(const __shared_ptr<_Tp1, _Lp>& __a,
  11125.        const __shared_ptr<_Tp2, _Lp>& __b) noexcept
  11126.     { return (__b < __a); }
  11127.   template<typename _Tp, _Lock_policy _Lp>
  11128.     inline bool
  11129.     operator>(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
  11130.     { return std::less<_Tp*>()(nullptr, __a.get()); }
  11131.   template<typename _Tp, _Lock_policy _Lp>
  11132.     inline bool
  11133.     operator>(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
  11134.     { return std::less<_Tp*>()(__a.get(), nullptr); }
  11135.   template<typename _Tp1, typename _Tp2, _Lock_policy _Lp>
  11136.     inline bool
  11137.     operator>=(const __shared_ptr<_Tp1, _Lp>& __a,
  11138.         const __shared_ptr<_Tp2, _Lp>& __b) noexcept
  11139.     { return !(__a < __b); }
  11140.   template<typename _Tp, _Lock_policy _Lp>
  11141.     inline bool
  11142.     operator>=(const __shared_ptr<_Tp, _Lp>& __a, nullptr_t) noexcept
  11143.     { return !(__a < nullptr); }
  11144.   template<typename _Tp, _Lock_policy _Lp>
  11145.     inline bool
  11146.     operator>=(nullptr_t, const __shared_ptr<_Tp, _Lp>& __a) noexcept
  11147.     { return !(nullptr < __a); }
  11148.   template<typename _Sp>
  11149.     struct _Sp_less : public binary_function<_Sp, _Sp, bool>
  11150.     {
  11151.       bool
  11152.       operator()(const _Sp& __lhs, const _Sp& __rhs) const noexcept
  11153.       {
  11154.  typedef typename _Sp::element_type element_type;
  11155.  return std::less<element_type*>()(__lhs.get(), __rhs.get());
  11156.       }
  11157.     };
  11158.   template<typename _Tp, _Lock_policy _Lp>
  11159.     struct less<__shared_ptr<_Tp, _Lp>>
  11160.     : public _Sp_less<__shared_ptr<_Tp, _Lp>>
  11161.     { };
  11162.   template<typename _Tp, _Lock_policy _Lp>
  11163.     inline void
  11164.     swap(__shared_ptr<_Tp, _Lp>& __a, __shared_ptr<_Tp, _Lp>& __b) noexcept
  11165.     { __a.swap(__b); }
  11166.   template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
  11167.     inline __shared_ptr<_Tp, _Lp>
  11168.     static_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
  11169.     { return __shared_ptr<_Tp, _Lp>(__r, static_cast<_Tp*>(__r.get())); }
  11170.   template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
  11171.     inline __shared_ptr<_Tp, _Lp>
  11172.     const_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
  11173.     { return __shared_ptr<_Tp, _Lp>(__r, const_cast<_Tp*>(__r.get())); }
  11174.   template<typename _Tp, typename _Tp1, _Lock_policy _Lp>
  11175.     inline __shared_ptr<_Tp, _Lp>
  11176.     dynamic_pointer_cast(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
  11177.     {
  11178.       if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
  11179.  return __shared_ptr<_Tp, _Lp>(__r, __p);
  11180.       return __shared_ptr<_Tp, _Lp>();
  11181.     }
  11182.   template<typename _Tp, _Lock_policy _Lp>
  11183.     class __weak_ptr
  11184.     {
  11185.     public:
  11186.       typedef _Tp element_type;
  11187.       constexpr __weak_ptr() noexcept
  11188.       : _M_ptr(0), _M_refcount()
  11189.       { }
  11190.       __weak_ptr(const __weak_ptr&) noexcept = default;
  11191.       __weak_ptr& operator=(const __weak_ptr&) noexcept = default;
  11192.       ~__weak_ptr() = default;
  11193.       template<typename _Tp1, typename = typename
  11194.         std::enable_if<std::is_convertible<_Tp1*, _Tp*>::value>::type>
  11195.  __weak_ptr(const __weak_ptr<_Tp1, _Lp>& __r) noexcept
  11196.  : _M_refcount(__r._M_refcount)
  11197.         { _M_ptr = __r.lock().get(); }
  11198.       template<typename _Tp1, typename = typename
  11199.         std::enable_if<std::is_convertible<_Tp1*, _Tp*>::value>::type>
  11200.  __weak_ptr(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
  11201.  : _M_ptr(__r._M_ptr), _M_refcount(__r._M_refcount)
  11202.  { }
  11203.       template<typename _Tp1>
  11204.  __weak_ptr&
  11205.  operator=(const __weak_ptr<_Tp1, _Lp>& __r) noexcept
  11206.  {
  11207.    _M_ptr = __r.lock().get();
  11208.    _M_refcount = __r._M_refcount;
  11209.    return *this;
  11210.  }
  11211.       template<typename _Tp1>
  11212.  __weak_ptr&
  11213.  operator=(const __shared_ptr<_Tp1, _Lp>& __r) noexcept
  11214.  {
  11215.    _M_ptr = __r._M_ptr;
  11216.    _M_refcount = __r._M_refcount;
  11217.    return *this;
  11218.  }
  11219.       __shared_ptr<_Tp, _Lp>
  11220.       lock() const noexcept
  11221.       {
  11222.  if (expired())
  11223.    return __shared_ptr<element_type, _Lp>();
  11224.  try
  11225.    {
  11226.      return __shared_ptr<element_type, _Lp>(*this);
  11227.    }
  11228.  catch(const bad_weak_ptr&)
  11229.    {
  11230.      return __shared_ptr<element_type, _Lp>();
  11231.    }
  11232.       }
  11233.       long
  11234.       use_count() const noexcept
  11235.       { return _M_refcount._M_get_use_count(); }
  11236.       bool
  11237.       expired() const noexcept
  11238.       { return _M_refcount._M_get_use_count() == 0; }
  11239.       template<typename _Tp1>
  11240.  bool
  11241.  owner_before(const __shared_ptr<_Tp1, _Lp>& __rhs) const
  11242.  { return _M_refcount._M_less(__rhs._M_refcount); }
  11243.       template<typename _Tp1>
  11244.  bool
  11245.  owner_before(const __weak_ptr<_Tp1, _Lp>& __rhs) const
  11246.  { return _M_refcount._M_less(__rhs._M_refcount); }
  11247.       void
  11248.       reset() noexcept
  11249.       { __weak_ptr().swap(*this); }
  11250.       void
  11251.       swap(__weak_ptr& __s) noexcept
  11252.       {
  11253.  std::swap(_M_ptr, __s._M_ptr);
  11254.  _M_refcount._M_swap(__s._M_refcount);
  11255.       }
  11256.     private:
  11257.       void
  11258.       _M_assign(_Tp* __ptr, const __shared_count<_Lp>& __refcount) noexcept
  11259.       {
  11260.  _M_ptr = __ptr;
  11261.  _M_refcount = __refcount;
  11262.       }
  11263.       template<typename _Tp1, _Lock_policy _Lp1> friend class __shared_ptr;
  11264.       template<typename _Tp1, _Lock_policy _Lp1> friend class __weak_ptr;
  11265.       friend class __enable_shared_from_this<_Tp, _Lp>;
  11266.       friend class enable_shared_from_this<_Tp>;
  11267.       _Tp* _M_ptr;
  11268.       __weak_count<_Lp> _M_refcount;
  11269.     };
  11270.   template<typename _Tp, _Lock_policy _Lp>
  11271.     inline void
  11272.     swap(__weak_ptr<_Tp, _Lp>& __a, __weak_ptr<_Tp, _Lp>& __b) noexcept
  11273.     { __a.swap(__b); }
  11274.   template<typename _Tp, typename _Tp1>
  11275.     struct _Sp_owner_less : public binary_function<_Tp, _Tp, bool>
  11276.     {
  11277.       bool
  11278.       operator()(const _Tp& __lhs, const _Tp& __rhs) const
  11279.       { return __lhs.owner_before(__rhs); }
  11280.       bool
  11281.       operator()(const _Tp& __lhs, const _Tp1& __rhs) const
  11282.       { return __lhs.owner_before(__rhs); }
  11283.       bool
  11284.       operator()(const _Tp1& __lhs, const _Tp& __rhs) const
  11285.       { return __lhs.owner_before(__rhs); }
  11286.     };
  11287.   template<typename _Tp, _Lock_policy _Lp>
  11288.     struct owner_less<__shared_ptr<_Tp, _Lp>>
  11289.     : public _Sp_owner_less<__shared_ptr<_Tp, _Lp>, __weak_ptr<_Tp, _Lp>>
  11290.     { };
  11291.   template<typename _Tp, _Lock_policy _Lp>
  11292.     struct owner_less<__weak_ptr<_Tp, _Lp>>
  11293.     : public _Sp_owner_less<__weak_ptr<_Tp, _Lp>, __shared_ptr<_Tp, _Lp>>
  11294.     { };
  11295.   template<typename _Tp, _Lock_policy _Lp>
  11296.     class __enable_shared_from_this
  11297.     {
  11298.     protected:
  11299.       constexpr __enable_shared_from_this() noexcept { }
  11300.       __enable_shared_from_this(const __enable_shared_from_this&) noexcept { }
  11301.       __enable_shared_from_this&
  11302.       operator=(const __enable_shared_from_this&) noexcept
  11303.       { return *this; }
  11304.       ~__enable_shared_from_this() { }
  11305.     public:
  11306.       __shared_ptr<_Tp, _Lp>
  11307.       shared_from_this()
  11308.       { return __shared_ptr<_Tp, _Lp>(this->_M_weak_this); }
  11309.       __shared_ptr<const _Tp, _Lp>
  11310.       shared_from_this() const
  11311.       { return __shared_ptr<const _Tp, _Lp>(this->_M_weak_this); }
  11312.     private:
  11313.       template<typename _Tp1>
  11314.  void
  11315.  _M_weak_assign(_Tp1* __p, const __shared_count<_Lp>& __n) const noexcept
  11316.  { _M_weak_this._M_assign(__p, __n); }
  11317.       template<typename _Tp1>
  11318.  friend void
  11319.  __enable_shared_from_this_helper(const __shared_count<_Lp>& __pn,
  11320.       const __enable_shared_from_this* __pe,
  11321.       const _Tp1* __px) noexcept
  11322.  {
  11323.    if (__pe != 0)
  11324.      __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
  11325.  }
  11326.       mutable __weak_ptr<_Tp, _Lp> _M_weak_this;
  11327.     };
  11328.   template<typename _Tp, _Lock_policy _Lp, typename _Alloc, typename... _Args>
  11329.     inline __shared_ptr<_Tp, _Lp>
  11330.     __allocate_shared(const _Alloc& __a, _Args&&... __args)
  11331.     {
  11332.       return __shared_ptr<_Tp, _Lp>(_Sp_make_shared_tag(), __a,
  11333.         std::forward<_Args>(__args)...);
  11334.     }
  11335.   template<typename _Tp, _Lock_policy _Lp, typename... _Args>
  11336.     inline __shared_ptr<_Tp, _Lp>
  11337.     __make_shared(_Args&&... __args)
  11338.     {
  11339.       typedef typename std::remove_const<_Tp>::type _Tp_nc;
  11340.       return std::__allocate_shared<_Tp, _Lp>(std::allocator<_Tp_nc>(),
  11341.            std::forward<_Args>(__args)...);
  11342.     }
  11343.   template<typename _Tp, _Lock_policy _Lp>
  11344.     struct hash<__shared_ptr<_Tp, _Lp>>
  11345.     : public __hash_base<size_t, __shared_ptr<_Tp, _Lp>>
  11346.     {
  11347.       size_t
  11348.       operator()(const __shared_ptr<_Tp, _Lp>& __s) const noexcept
  11349.       { return std::hash<_Tp*>()(__s.get()); }
  11350.     };
  11351.  
  11352. }
  11353. namespace std __attribute__ ((__visibility__ ("default")))
  11354. {
  11355.  
  11356.   template<typename _Ch, typename _Tr, typename _Tp, _Lock_policy _Lp>
  11357.     inline std::basic_ostream<_Ch, _Tr>&
  11358.     operator<<(std::basic_ostream<_Ch, _Tr>& __os,
  11359.         const __shared_ptr<_Tp, _Lp>& __p)
  11360.     {
  11361.       __os << __p.get();
  11362.       return __os;
  11363.     }
  11364.   template<typename _Del, typename _Tp, _Lock_policy _Lp>
  11365.     inline _Del*
  11366.     get_deleter(const __shared_ptr<_Tp, _Lp>& __p) noexcept
  11367.     {
  11368.       return static_cast<_Del*>(__p._M_get_deleter(typeid(_Del)));
  11369.     }
  11370.   template<typename _Tp>
  11371.     class shared_ptr : public __shared_ptr<_Tp>
  11372.     {
  11373.     public:
  11374.       constexpr shared_ptr() noexcept
  11375.       : __shared_ptr<_Tp>() { }
  11376.       shared_ptr(const shared_ptr&) noexcept = default;
  11377.       template<typename _Tp1>
  11378.  explicit shared_ptr(_Tp1* __p)
  11379.         : __shared_ptr<_Tp>(__p) { }
  11380.       template<typename _Tp1, typename _Deleter>
  11381.  shared_ptr(_Tp1* __p, _Deleter __d)
  11382.         : __shared_ptr<_Tp>(__p, __d) { }
  11383.       template<typename _Deleter>
  11384.  shared_ptr(nullptr_t __p, _Deleter __d)
  11385.         : __shared_ptr<_Tp>(__p, __d) { }
  11386.       template<typename _Tp1, typename _Deleter, typename _Alloc>
  11387.  shared_ptr(_Tp1* __p, _Deleter __d, _Alloc __a)
  11388.  : __shared_ptr<_Tp>(__p, __d, std::move(__a)) { }
  11389.       template<typename _Deleter, typename _Alloc>
  11390.  shared_ptr(nullptr_t __p, _Deleter __d, _Alloc __a)
  11391.  : __shared_ptr<_Tp>(__p, __d, std::move(__a)) { }
  11392.       template<typename _Tp1>
  11393.  shared_ptr(const shared_ptr<_Tp1>& __r, _Tp* __p) noexcept
  11394.  : __shared_ptr<_Tp>(__r, __p) { }
  11395.       template<typename _Tp1, typename = typename
  11396.         std::enable_if<std::is_convertible<_Tp1*, _Tp*>::value>::type>
  11397.  shared_ptr(const shared_ptr<_Tp1>& __r) noexcept
  11398.         : __shared_ptr<_Tp>(__r) { }
  11399.       shared_ptr(shared_ptr&& __r) noexcept
  11400.       : __shared_ptr<_Tp>(std::move(__r)) { }
  11401.       template<typename _Tp1, typename = typename
  11402.         std::enable_if<std::is_convertible<_Tp1*, _Tp*>::value>::type>
  11403.  shared_ptr(shared_ptr<_Tp1>&& __r) noexcept
  11404.  : __shared_ptr<_Tp>(std::move(__r)) { }
  11405.       template<typename _Tp1>
  11406.  explicit shared_ptr(const weak_ptr<_Tp1>& __r)
  11407.  : __shared_ptr<_Tp>(__r) { }
  11408.       template<typename _Tp1>
  11409.  shared_ptr(std::auto_ptr<_Tp1>&& __r)
  11410.  : __shared_ptr<_Tp>(std::move(__r)) { }
  11411.       template<typename _Tp1, typename _Del>
  11412.  shared_ptr(std::unique_ptr<_Tp1, _Del>&& __r)
  11413.  : __shared_ptr<_Tp>(std::move(__r)) { }
  11414.       constexpr shared_ptr(nullptr_t __p) noexcept
  11415.       : __shared_ptr<_Tp>(__p) { }
  11416.       shared_ptr& operator=(const shared_ptr&) noexcept = default;
  11417.       template<typename _Tp1>
  11418.  shared_ptr&
  11419.  operator=(const shared_ptr<_Tp1>& __r) noexcept
  11420.  {
  11421.    this->__shared_ptr<_Tp>::operator=(__r);
  11422.    return *this;
  11423.  }
  11424.       template<typename _Tp1>
  11425.  shared_ptr&
  11426.  operator=(std::auto_ptr<_Tp1>&& __r)
  11427.  {
  11428.    this->__shared_ptr<_Tp>::operator=(std::move(__r));
  11429.    return *this;
  11430.  }
  11431.       shared_ptr&
  11432.       operator=(shared_ptr&& __r) noexcept
  11433.       {
  11434.  this->__shared_ptr<_Tp>::operator=(std::move(__r));
  11435.  return *this;
  11436.       }
  11437.       template<class _Tp1>
  11438.  shared_ptr&
  11439.  operator=(shared_ptr<_Tp1>&& __r) noexcept
  11440.  {
  11441.    this->__shared_ptr<_Tp>::operator=(std::move(__r));
  11442.    return *this;
  11443.  }
  11444.       template<typename _Tp1, typename _Del>
  11445.  shared_ptr&
  11446.  operator=(std::unique_ptr<_Tp1, _Del>&& __r)
  11447.  {
  11448.    this->__shared_ptr<_Tp>::operator=(std::move(__r));
  11449.    return *this;
  11450.  }
  11451.     private:
  11452.       template<typename _Alloc, typename... _Args>
  11453.  shared_ptr(_Sp_make_shared_tag __tag, const _Alloc& __a,
  11454.      _Args&&... __args)
  11455.  : __shared_ptr<_Tp>(__tag, __a, std::forward<_Args>(__args)...)
  11456.  { }
  11457.       template<typename _Tp1, typename _Alloc, typename... _Args>
  11458.  friend shared_ptr<_Tp1>
  11459.  allocate_shared(const _Alloc& __a, _Args&&... __args);
  11460.     };
  11461.   template<typename _Tp1, typename _Tp2>
  11462.     inline bool
  11463.     operator==(const shared_ptr<_Tp1>& __a,
  11464.         const shared_ptr<_Tp2>& __b) noexcept
  11465.     { return __a.get() == __b.get(); }
  11466.   template<typename _Tp>
  11467.     inline bool
  11468.     operator==(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
  11469.     { return !__a; }
  11470.   template<typename _Tp>
  11471.     inline bool
  11472.     operator==(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
  11473.     { return !__a; }
  11474.   template<typename _Tp1, typename _Tp2>
  11475.     inline bool
  11476.     operator!=(const shared_ptr<_Tp1>& __a,
  11477.         const shared_ptr<_Tp2>& __b) noexcept
  11478.     { return __a.get() != __b.get(); }
  11479.   template<typename _Tp>
  11480.     inline bool
  11481.     operator!=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
  11482.     { return (bool)__a; }
  11483.   template<typename _Tp>
  11484.     inline bool
  11485.     operator!=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
  11486.     { return (bool)__a; }
  11487.   template<typename _Tp1, typename _Tp2>
  11488.     inline bool
  11489.     operator<(const shared_ptr<_Tp1>& __a,
  11490.        const shared_ptr<_Tp2>& __b) noexcept
  11491.     {
  11492.       typedef typename std::common_type<_Tp1*, _Tp2*>::type _CT;
  11493.       return std::less<_CT>()(__a.get(), __b.get());
  11494.     }
  11495.   template<typename _Tp>
  11496.     inline bool
  11497.     operator<(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
  11498.     { return std::less<_Tp*>()(__a.get(), nullptr); }
  11499.   template<typename _Tp>
  11500.     inline bool
  11501.     operator<(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
  11502.     { return std::less<_Tp*>()(nullptr, __a.get()); }
  11503.   template<typename _Tp1, typename _Tp2>
  11504.     inline bool
  11505.     operator<=(const shared_ptr<_Tp1>& __a,
  11506.         const shared_ptr<_Tp2>& __b) noexcept
  11507.     { return !(__b < __a); }
  11508.   template<typename _Tp>
  11509.     inline bool
  11510.     operator<=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
  11511.     { return !(nullptr < __a); }
  11512.   template<typename _Tp>
  11513.     inline bool
  11514.     operator<=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
  11515.     { return !(__a < nullptr); }
  11516.   template<typename _Tp1, typename _Tp2>
  11517.     inline bool
  11518.     operator>(const shared_ptr<_Tp1>& __a,
  11519.        const shared_ptr<_Tp2>& __b) noexcept
  11520.     { return (__b < __a); }
  11521.   template<typename _Tp>
  11522.     inline bool
  11523.     operator>(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
  11524.     { return std::less<_Tp*>()(nullptr, __a.get()); }
  11525.   template<typename _Tp>
  11526.     inline bool
  11527.     operator>(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
  11528.     { return std::less<_Tp*>()(__a.get(), nullptr); }
  11529.   template<typename _Tp1, typename _Tp2>
  11530.     inline bool
  11531.     operator>=(const shared_ptr<_Tp1>& __a,
  11532.         const shared_ptr<_Tp2>& __b) noexcept
  11533.     { return !(__a < __b); }
  11534.   template<typename _Tp>
  11535.     inline bool
  11536.     operator>=(const shared_ptr<_Tp>& __a, nullptr_t) noexcept
  11537.     { return !(__a < nullptr); }
  11538.   template<typename _Tp>
  11539.     inline bool
  11540.     operator>=(nullptr_t, const shared_ptr<_Tp>& __a) noexcept
  11541.     { return !(nullptr < __a); }
  11542.   template<typename _Tp>
  11543.     struct less<shared_ptr<_Tp>> : public _Sp_less<shared_ptr<_Tp>>
  11544.     { };
  11545.   template<typename _Tp>
  11546.     inline void
  11547.     swap(shared_ptr<_Tp>& __a, shared_ptr<_Tp>& __b) noexcept
  11548.     { __a.swap(__b); }
  11549.   template<typename _Tp, typename _Tp1>
  11550.     inline shared_ptr<_Tp>
  11551.     static_pointer_cast(const shared_ptr<_Tp1>& __r) noexcept
  11552.     { return shared_ptr<_Tp>(__r, static_cast<_Tp*>(__r.get())); }
  11553.   template<typename _Tp, typename _Tp1>
  11554.     inline shared_ptr<_Tp>
  11555.     const_pointer_cast(const shared_ptr<_Tp1>& __r) noexcept
  11556.     { return shared_ptr<_Tp>(__r, const_cast<_Tp*>(__r.get())); }
  11557.   template<typename _Tp, typename _Tp1>
  11558.     inline shared_ptr<_Tp>
  11559.     dynamic_pointer_cast(const shared_ptr<_Tp1>& __r) noexcept
  11560.     {
  11561.       if (_Tp* __p = dynamic_cast<_Tp*>(__r.get()))
  11562.  return shared_ptr<_Tp>(__r, __p);
  11563.       return shared_ptr<_Tp>();
  11564.     }
  11565.   template<typename _Tp>
  11566.     class weak_ptr : public __weak_ptr<_Tp>
  11567.     {
  11568.     public:
  11569.       constexpr weak_ptr() noexcept
  11570.       : __weak_ptr<_Tp>() { }
  11571.       template<typename _Tp1, typename = typename
  11572.         std::enable_if<std::is_convertible<_Tp1*, _Tp*>::value>::type>
  11573.  weak_ptr(const weak_ptr<_Tp1>& __r) noexcept
  11574.  : __weak_ptr<_Tp>(__r) { }
  11575.       template<typename _Tp1, typename = typename
  11576.         std::enable_if<std::is_convertible<_Tp1*, _Tp*>::value>::type>
  11577.  weak_ptr(const shared_ptr<_Tp1>& __r) noexcept
  11578.  : __weak_ptr<_Tp>(__r) { }
  11579.       template<typename _Tp1>
  11580.  weak_ptr&
  11581.  operator=(const weak_ptr<_Tp1>& __r) noexcept
  11582.  {
  11583.    this->__weak_ptr<_Tp>::operator=(__r);
  11584.    return *this;
  11585.  }
  11586.       template<typename _Tp1>
  11587.  weak_ptr&
  11588.  operator=(const shared_ptr<_Tp1>& __r) noexcept
  11589.  {
  11590.    this->__weak_ptr<_Tp>::operator=(__r);
  11591.    return *this;
  11592.  }
  11593.       shared_ptr<_Tp>
  11594.       lock() const noexcept
  11595.       {
  11596.  if (this->expired())
  11597.    return shared_ptr<_Tp>();
  11598.  try
  11599.    {
  11600.      return shared_ptr<_Tp>(*this);
  11601.    }
  11602.  catch(const bad_weak_ptr&)
  11603.    {
  11604.      return shared_ptr<_Tp>();
  11605.    }
  11606.       }
  11607.     };
  11608.   template<typename _Tp>
  11609.     inline void
  11610.     swap(weak_ptr<_Tp>& __a, weak_ptr<_Tp>& __b) noexcept
  11611.     { __a.swap(__b); }
  11612.   template<typename _Tp>
  11613.     struct owner_less;
  11614.   template<typename _Tp>
  11615.     struct owner_less<shared_ptr<_Tp>>
  11616.     : public _Sp_owner_less<shared_ptr<_Tp>, weak_ptr<_Tp>>
  11617.     { };
  11618.   template<typename _Tp>
  11619.     struct owner_less<weak_ptr<_Tp>>
  11620.     : public _Sp_owner_less<weak_ptr<_Tp>, shared_ptr<_Tp>>
  11621.     { };
  11622.   template<typename _Tp>
  11623.     class enable_shared_from_this
  11624.     {
  11625.     protected:
  11626.       constexpr enable_shared_from_this() noexcept { }
  11627.       enable_shared_from_this(const enable_shared_from_this&) noexcept { }
  11628.       enable_shared_from_this&
  11629.       operator=(const enable_shared_from_this&) noexcept
  11630.       { return *this; }
  11631.       ~enable_shared_from_this() { }
  11632.     public:
  11633.       shared_ptr<_Tp>
  11634.       shared_from_this()
  11635.       { return shared_ptr<_Tp>(this->_M_weak_this); }
  11636.       shared_ptr<const _Tp>
  11637.       shared_from_this() const
  11638.       { return shared_ptr<const _Tp>(this->_M_weak_this); }
  11639.     private:
  11640.       template<typename _Tp1>
  11641.  void
  11642.  _M_weak_assign(_Tp1* __p, const __shared_count<>& __n) const noexcept
  11643.  { _M_weak_this._M_assign(__p, __n); }
  11644.       template<typename _Tp1>
  11645.  friend void
  11646.  __enable_shared_from_this_helper(const __shared_count<>& __pn,
  11647.       const enable_shared_from_this* __pe,
  11648.       const _Tp1* __px) noexcept
  11649.  {
  11650.    if (__pe != 0)
  11651.      __pe->_M_weak_assign(const_cast<_Tp1*>(__px), __pn);
  11652.  }
  11653.       mutable weak_ptr<_Tp> _M_weak_this;
  11654.     };
  11655.   template<typename _Tp, typename _Alloc, typename... _Args>
  11656.     inline shared_ptr<_Tp>
  11657.     allocate_shared(const _Alloc& __a, _Args&&... __args)
  11658.     {
  11659.       return shared_ptr<_Tp>(_Sp_make_shared_tag(), __a,
  11660.         std::forward<_Args>(__args)...);
  11661.     }
  11662.   template<typename _Tp, typename... _Args>
  11663.     inline shared_ptr<_Tp>
  11664.     make_shared(_Args&&... __args)
  11665.     {
  11666.       typedef typename std::remove_const<_Tp>::type _Tp_nc;
  11667.       return std::allocate_shared<_Tp>(std::allocator<_Tp_nc>(),
  11668.            std::forward<_Args>(__args)...);
  11669.     }
  11670.   template<typename _Tp>
  11671.     struct hash<shared_ptr<_Tp>>
  11672.     : public __hash_base<size_t, shared_ptr<_Tp>>
  11673.     {
  11674.       size_t
  11675.       operator()(const shared_ptr<_Tp>& __s) const noexcept
  11676.       { return std::hash<_Tp*>()(__s.get()); }
  11677.     };
  11678.  
  11679. }
  11680. int main()
  11681. {
  11682.  std::tr1::auto_ptr<int> a(new int);
  11683.  return 0;
  11684. }
Advertisement
Add Comment
Please, Sign In to add comment