59#if __cplusplus >= 201103L
64#if __cplusplus >= 202002L
68namespace std _GLIBCXX_VISIBILITY(default)
70_GLIBCXX_BEGIN_NAMESPACE_VERSION
77#if __cplusplus >= 201103L
94#if ! __cpp_lib_concepts
100 template <
bool,
typename _T1,
typename _T2>
103 template <
typename _U1,
typename _U2>
104 static constexpr bool _ConstructiblePair()
106 return __and_<is_constructible<_T1, const _U1&>,
110 template <
typename _U1,
typename _U2>
111 static constexpr bool _ImplicitlyConvertiblePair()
113 return __and_<is_convertible<const _U1&, _T1>,
114 is_convertible<const _U2&, _T2>>::value;
117 template <
typename _U1,
typename _U2>
118 static constexpr bool _MoveConstructiblePair()
120 return __and_<is_constructible<_T1, _U1&&>,
121 is_constructible<_T2, _U2&&>>::value;
124 template <
typename _U1,
typename _U2>
125 static constexpr bool _ImplicitlyMoveConvertiblePair()
127 return __and_<is_convertible<_U1&&, _T1>,
128 is_convertible<_U2&&, _T2>>::value;
132 template <
typename _T1,
typename _T2>
133 struct _PCC<false, _T1, _T2>
135 template <
typename _U1,
typename _U2>
136 static constexpr bool _ConstructiblePair()
141 template <
typename _U1,
typename _U2>
142 static constexpr bool _ImplicitlyConvertiblePair()
147 template <
typename _U1,
typename _U2>
148 static constexpr bool _MoveConstructiblePair()
153 template <
typename _U1,
typename _U2>
154 static constexpr bool _ImplicitlyMoveConvertiblePair()
162 template<
typename _U1,
typename _U2>
class __pair_base
164#if __cplusplus >= 201103L && ! __cpp_lib_concepts
165 template<
typename _T1,
typename _T2>
friend struct pair;
166 __pair_base() =
default;
167 ~__pair_base() =
default;
168 __pair_base(
const __pair_base&) =
default;
169 __pair_base& operator=(
const __pair_base&) =
delete;
185 template<
typename _T1,
typename _T2>
187 :
public __pair_base<_T1, _T2>
195#if __cplusplus >= 201103L
199 template<
typename... _Args1,
typename... _Args2>
204 _GLIBCXX20_CONSTEXPR
void
206 noexcept(__and_<__is_nothrow_swappable<_T1>,
207 __is_nothrow_swappable<_T2>>::value)
214#if __glibcxx_ranges_zip
223 noexcept(__and_v<__is_nothrow_swappable<const _T1>,
224 __is_nothrow_swappable<const _T2>>)
225 requires is_swappable_v<const _T1> && is_swappable_v<const _T2>
234 template<
typename... _Args1,
size_t... _Indexes1,
235 typename... _Args2,
size_t... _Indexes2>
237 pair(tuple<_Args1...>&, tuple<_Args2...>&,
238 _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
241#if __cpp_lib_concepts
246 explicit(__not_<__and_<__is_implicitly_default_constructible<_T1>,
247 __is_implicitly_default_constructible<_T2>>>())
249 requires is_default_constructible_v<_T1>
250 && is_default_constructible_v<_T2>
257 template<
typename _U1,
typename _U2>
258 static constexpr bool
261 if constexpr (is_constructible_v<_T1, _U1>)
262 return is_constructible_v<_T2, _U2>;
266 template<
typename _U1,
typename _U2>
267 static constexpr bool
268 _S_nothrow_constructible()
270 if constexpr (is_nothrow_constructible_v<_T1, _U1>)
271 return is_nothrow_constructible_v<_T2, _U2>;
275 template<
typename _U1,
typename _U2>
276 static constexpr bool
279 if constexpr (is_convertible_v<_U1, _T1>)
280 return is_convertible_v<_U2, _T2>;
285 template<
typename _U1,
typename _U2>
286 static constexpr bool
289#if __has_builtin(__reference_constructs_from_temporary)
290 if constexpr (__reference_constructs_from_temporary(_T1, _U1&&))
293 return __reference_constructs_from_temporary(_T2, _U2&&);
303 constexpr explicit(!_S_convertible<const _T1&, const _T2&>())
304 pair(
const _T1& __x,
const _T2& __y)
305 noexcept(_S_nothrow_constructible<const _T1&, const _T2&>())
306 requires (_S_constructible<const _T1&, const _T2&>())
311#if __cplusplus > 202002L
312 template<
typename _U1 = _T1,
typename _U2 = _T2>
314 template<
typename _U1,
typename _U2>
316 requires (_S_constructible<_U1, _U2>()) && (!_S_dangles<_U1, _U2>())
317 constexpr explicit(!_S_convertible<_U1, _U2>())
318 pair(_U1&& __x, _U2&& __y)
319 noexcept(_S_nothrow_constructible<_U1, _U2>())
320 :
first(std::forward<_U1>(__x)),
second(std::forward<_U2>(__y))
323#if __cplusplus > 202002L
324 template<
typename _U1 = _T1,
typename _U2 = _T2>
326 template<
typename _U1,
typename _U2>
328 requires (_S_constructible<_U1, _U2>()) && (_S_dangles<_U1, _U2>())
329 constexpr explicit(!_S_convertible<_U1, _U2>())
330 pair(_U1&&, _U2&&) =
delete;
333 template<
typename _U1,
typename _U2>
334 requires (_S_constructible<const _U1&, const _U2&>())
335 && (!_S_dangles<_U1, _U2>())
336 constexpr explicit(!_S_convertible<const _U1&, const _U2&>())
337 pair(
const pair<_U1, _U2>& __p)
338 noexcept(_S_nothrow_constructible<const _U1&, const _U2&>())
342 template<
typename _U1,
typename _U2>
343 requires (_S_constructible<const _U1&, const _U2&>())
344 && (_S_dangles<const _U1&, const _U2&>())
345 constexpr explicit(!_S_convertible<const _U1&, const _U2&>())
346 pair(
const pair<_U1, _U2>&) =
delete;
349 template<
typename _U1,
typename _U2>
350 requires (_S_constructible<_U1, _U2>()) && (!_S_dangles<_U1, _U2>())
351 constexpr explicit(!_S_convertible<_U1, _U2>())
352 pair(pair<_U1, _U2>&& __p)
353 noexcept(_S_nothrow_constructible<_U1, _U2>())
354 :
first(std::forward<_U1>(__p.first)),
355 second(std::forward<_U2>(__p.second))
358 template<
typename _U1,
typename _U2>
359 requires (_S_constructible<_U1, _U2>()) && (_S_dangles<_U1, _U2>())
360 constexpr explicit(!_S_convertible<_U1, _U2>())
361 pair(pair<_U1, _U2>&&) =
delete;
363#if __glibcxx_ranges_zip
365 template<typename _U1, typename _U2>
366 requires (_S_constructible<_U1&, _U2&>()) && (!_S_dangles<_U1&, _U2&>())
367 constexpr explicit(!_S_convertible<_U1&, _U2&>())
368 pair(pair<_U1, _U2>& __p)
369 noexcept(_S_nothrow_constructible<_U1&, _U2&>())
373 template<
typename _U1,
typename _U2>
374 requires (_S_constructible<_U1&, _U2&>()) && (_S_dangles<_U1&, _U2&>())
375 constexpr explicit(!_S_convertible<_U1&, _U2&>())
376 pair(pair<_U1, _U2>&) =
delete;
379 template<
typename _U1,
typename _U2>
380 requires (_S_constructible<const _U1, const _U2>())
381 && (!_S_dangles<const _U1, const _U2>())
382 constexpr explicit(!_S_convertible<const _U1, const _U2>())
383 pair(
const pair<_U1, _U2>&& __p)
384 noexcept(_S_nothrow_constructible<const _U1, const _U2>())
385 :
first(std::forward<const _U1>(__p.first)),
386 second(std::forward<const _U2>(__p.second))
389 template<
typename _U1,
typename _U2>
390 requires (_S_constructible<const _U1, const _U2>())
391 && (_S_dangles<const _U1, const _U2>())
392 constexpr explicit(!_S_convertible<const _U1, const _U2>())
393 pair(
const pair<_U1, _U2>&&) =
delete;
398 template<
typename _U1,
typename _U2>
399 static constexpr bool
402 if constexpr (is_assignable_v<_T1&, _U1>)
403 return is_assignable_v<_T2&, _U2>;
407 template<
typename _U1,
typename _U2>
408 static constexpr bool
409 _S_nothrow_assignable()
411 if constexpr (is_nothrow_assignable_v<_T1&, _U1>)
412 return is_nothrow_assignable_v<_T2&, _U2>;
419 pair& operator=(
const pair&) =
delete;
423 operator=(
const pair& __p)
424 noexcept(_S_nothrow_assignable<const _T1&, const _T2&>())
425 requires (_S_assignable<const _T1&, const _T2&>())
434 operator=(
pair&& __p)
435 noexcept(_S_nothrow_assignable<_T1, _T2>())
436 requires (_S_assignable<_T1, _T2>())
438 first = std::forward<first_type>(__p.first);
439 second = std::forward<second_type>(__p.second);
444 template<
typename _U1,
typename _U2>
446 operator=(
const pair<_U1, _U2>& __p)
447 noexcept(_S_nothrow_assignable<const _U1&, const _U2&>())
448 requires (_S_assignable<const _U1&, const _U2&>())
456 template<
typename _U1,
typename _U2>
458 operator=(pair<_U1, _U2>&& __p)
459 noexcept(_S_nothrow_assignable<_U1, _U2>())
460 requires (_S_assignable<_U1, _U2>())
462 first = std::forward<_U1>(__p.first);
463 second = std::forward<_U2>(__p.second);
467#if __glibcxx_ranges_zip
469 constexpr const pair&
470 operator=(
const pair& __p)
const
471 requires is_copy_assignable_v<const first_type>
472 && is_copy_assignable_v<const second_type>
480 constexpr const pair&
481 operator=(
pair&& __p)
const
482 requires is_assignable_v<const first_type&, first_type>
483 && is_assignable_v<const second_type&, second_type>
485 first = std::forward<first_type>(__p.first);
486 second = std::forward<second_type>(__p.second);
491 template<
typename _U1,
typename _U2>
492 constexpr const pair&
493 operator=(
const pair<_U1, _U2>& __p)
const
494 requires is_assignable_v<const first_type&, const _U1&>
495 && is_assignable_v<const second_type&, const _U2&>
503 template<
typename _U1,
typename _U2>
504 constexpr const pair&
505 operator=(pair<_U1, _U2>&& __p)
const
506 requires is_assignable_v<const first_type&, _U1>
507 && is_assignable_v<const second_type&, _U2>
509 first = std::forward<_U1>(__p.first);
510 second = std::forward<_U2>(__p.second);
519#if __has_builtin(__reference_constructs_from_temporary) \
520 && defined _GLIBCXX_DEBUG
521# define __glibcxx_no_dangling_refs(_U1, _U2) \
522 static_assert(!__reference_constructs_from_temporary(_T1, _U1) \
523 && !__reference_constructs_from_temporary(_T2, _U2), \
524 "std::pair constructor creates a dangling reference")
526# define __glibcxx_no_dangling_refs(_U1, _U2)
532 template <
typename _U1 = _T1,
534 typename enable_if<__and_<
535 __is_implicitly_default_constructible<_U1>,
536 __is_implicitly_default_constructible<_U2>>
537 ::value,
bool>::type =
true>
541 template <
typename _U1 = _T1,
547 __and_<__is_implicitly_default_constructible<_U1>,
548 __is_implicitly_default_constructible<_U2>>>>
549 ::value,
bool>::type =
false>
550 explicit constexpr pair()
555 using _PCCP = _PCC<true, _T1, _T2>;
559 template<
typename _U1 = _T1,
typename _U2=_T2,
typename
560 enable_if<_PCCP::template
561 _ConstructiblePair<_U1, _U2>()
563 _ImplicitlyConvertiblePair<_U1, _U2>(),
565 constexpr pair(
const _T1& __a,
const _T2& __b)
569 template<
typename _U1 = _T1,
typename _U2=_T2,
typename
571 _ConstructiblePair<_U1, _U2>()
573 _ImplicitlyConvertiblePair<_U1, _U2>(),
575 explicit constexpr pair(
const _T1& __a,
const _T2& __b)
580 template <
typename _U1,
typename _U2>
581 using _PCCFP = _PCC<!is_same<_T1, _U1>::value
586 template<
typename _U1,
typename _U2,
typename
588 _ConstructiblePair<_U1, _U2>()
589 && _PCCFP<_U1, _U2>::template
590 _ImplicitlyConvertiblePair<_U1, _U2>(),
594 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
596 template<
typename _U1,
typename _U2,
typename
597 enable_if<_PCCFP<_U1, _U2>::template
598 _ConstructiblePair<_U1, _U2>()
599 && !_PCCFP<_U1, _U2>::template
600 _ImplicitlyConvertiblePair<_U1, _U2>(),
602 explicit constexpr pair(
const pair<_U1, _U2>& __p)
604 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
606#if _GLIBCXX_USE_DEPRECATED
607#if defined(__DEPRECATED)
608# define _GLIBCXX_DEPRECATED_PAIR_CTOR \
609 __attribute__ ((__deprecated__ ("use 'nullptr' instead of '0' to " \
610 "initialize std::pair of move-only " \
611 "type and pointer")))
613# define _GLIBCXX_DEPRECATED_PAIR_CTOR
620 struct __zero_as_null_pointer_constant
622 __zero_as_null_pointer_constant(
int __zero_as_null_pointer_constant::*)
624 template<
typename _Tp,
625 typename = __enable_if_t<is_null_pointer<_Tp>::value>>
626 __zero_as_null_pointer_constant(_Tp) =
delete;
634 template<
typename _U1,
635 __enable_if_t<__and_<__not_<is_reference<_U1>>,
637 is_constructible<_T1, _U1>,
638 __not_<is_constructible<_T1, const _U1&>>,
639 is_convertible<_U1, _T1>>::value,
641 _GLIBCXX_DEPRECATED_PAIR_CTOR
643 pair(_U1&& __x, __zero_as_null_pointer_constant, ...)
645 { __glibcxx_no_dangling_refs(_U1&&, std::nullptr_t); }
647 template<
typename _U1,
648 __enable_if_t<__and_<__not_<is_reference<_U1>>,
650 is_constructible<_T1, _U1>,
651 __not_<is_constructible<_T1, const _U1&>>,
652 __not_<is_convertible<_U1, _T1>>>::value,
654 _GLIBCXX_DEPRECATED_PAIR_CTOR
656 pair(_U1&& __x, __zero_as_null_pointer_constant, ...)
658 { __glibcxx_no_dangling_refs(_U1&&, std::nullptr_t); }
660 template<
typename _U2,
661 __enable_if_t<__and_<is_pointer<_T1>,
662 __not_<is_reference<_U2>>,
663 is_constructible<_T2, _U2>,
664 __not_<is_constructible<_T2, const _U2&>>,
665 is_convertible<_U2, _T2>>::value,
667 _GLIBCXX_DEPRECATED_PAIR_CTOR
669 pair(__zero_as_null_pointer_constant, _U2&& __y, ...)
671 { __glibcxx_no_dangling_refs(std::nullptr_t, _U2&&); }
673 template<
typename _U2,
674 __enable_if_t<__and_<is_pointer<_T1>,
675 __not_<is_reference<_U2>>,
676 is_constructible<_T2, _U2>,
677 __not_<is_constructible<_T2, const _U2&>>,
678 __not_<is_convertible<_U2, _T2>>>::value,
680 _GLIBCXX_DEPRECATED_PAIR_CTOR
682 pair(__zero_as_null_pointer_constant, _U2&& __y, ...)
684 { __glibcxx_no_dangling_refs(std::nullptr_t, _U2&&); }
685#undef _GLIBCXX_DEPRECATED_PAIR_CTOR
688 template<
typename _U1,
typename _U2,
typename
689 enable_if<_PCCP::template
690 _MoveConstructiblePair<_U1, _U2>()
692 _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
694 constexpr pair(_U1&& __x, _U2&& __y)
696 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
698 template<
typename _U1,
typename _U2,
typename
699 enable_if<_PCCP::template
700 _MoveConstructiblePair<_U1, _U2>()
702 _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
704 explicit constexpr pair(_U1&& __x, _U2&& __y)
706 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
709 template<
typename _U1,
typename _U2,
typename
710 enable_if<_PCCFP<_U1, _U2>::template
711 _MoveConstructiblePair<_U1, _U2>()
712 && _PCCFP<_U1, _U2>::template
713 _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
715 constexpr pair(pair<_U1, _U2>&& __p)
718 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
720 template<
typename _U1,
typename _U2,
typename
721 enable_if<_PCCFP<_U1, _U2>::template
722 _MoveConstructiblePair<_U1, _U2>()
723 && !_PCCFP<_U1, _U2>::template
724 _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
726 explicit constexpr pair(pair<_U1, _U2>&& __p)
729 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
731#undef __glibcxx_no_dangling_refs
734 operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
735 is_copy_assignable<_T2>>::value,
736 const pair&,
const __nonesuch&> __p)
744 operator=(__conditional_t<__and_<is_move_assignable<_T1>,
745 is_move_assignable<_T2>>::value,
746 pair&&, __nonesuch&&> __p)
747 noexcept(__and_<is_nothrow_move_assignable<_T1>,
748 is_nothrow_move_assignable<_T2>>::value)
750 first = std::forward<first_type>(__p.first);
751 second = std::forward<second_type>(__p.second);
755 template<
typename _U1,
typename _U2>
756 typename enable_if<__and_<is_assignable<_T1&, const _U1&>,
757 is_assignable<_T2&, const _U2&>>::value,
759 operator=(
const pair<_U1, _U2>& __p)
766 template<
typename _U1,
typename _U2>
767 typename enable_if<__and_<is_assignable<_T1&, _U1&&>,
768 is_assignable<_T2&, _U2&&>>::value,
770 operator=(pair<_U1, _U2>&& __p)
772 first = std::forward<_U1>(__p.first);
773 second = std::forward<_U2>(__p.second);
787 pair(
const _T1& __a,
const _T2& __b)
791 template<
typename _U1,
typename _U2>
792 pair(
const pair<_U1, _U2>& __p)
795#if __has_builtin(__reference_constructs_from_temporary)
796#pragma GCC diagnostic push
797#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
798 typedef int _DanglingCheck1[
799 __reference_constructs_from_temporary(_T1,
const _U1&) ? -1 : 1
801 typedef int _DanglingCheck2[
802 __reference_constructs_from_temporary(_T2,
const _U2&) ? -1 : 1
804#pragma GCC diagnostic pop
812#if __cpp_deduction_guides >= 201606
817 template<
typename _T1,
typename _T2>
818 inline _GLIBCXX_CONSTEXPR
bool
822#if __cpp_lib_three_way_comparison && __cpp_lib_concepts
823 template<
typename _T1,
typename _T2>
824 constexpr common_comparison_category_t<__detail::__synth3way_t<_T1>,
825 __detail::__synth3way_t<_T2>>
828 if (
auto __c = __detail::__synth3way(__x.
first, __y.
first); __c != 0)
840 template<
typename _T1,
typename _T2>
841 inline _GLIBCXX_CONSTEXPR
bool
847 template<
typename _T1,
typename _T2>
848 inline _GLIBCXX_CONSTEXPR
bool
850 {
return !(__x == __y); }
853 template<
typename _T1,
typename _T2>
854 inline _GLIBCXX_CONSTEXPR
bool
856 {
return __y < __x; }
859 template<
typename _T1,
typename _T2>
860 inline _GLIBCXX_CONSTEXPR
bool
862 {
return !(__y < __x); }
865 template<
typename _T1,
typename _T2>
866 inline _GLIBCXX_CONSTEXPR
bool
868 {
return !(__x < __y); }
871#if __cplusplus >= 201103L
877 template<
typename _T1,
typename _T2>
878 _GLIBCXX20_CONSTEXPR
inline
879#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
882 __is_swappable<_T2>>::value>::type
887 noexcept(
noexcept(__x.
swap(__y)))
890#if __glibcxx_ranges_zip
891 template<
typename _T1,
typename _T2>
892 requires is_swappable_v<const _T1> && is_swappable_v<const _T2>
895 noexcept(
noexcept(__x.
swap(__y)))
899#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
900 template<
typename _T1,
typename _T2>
901 typename enable_if<!__and_<__is_swappable<_T1>,
902 __is_swappable<_T2>>::value>::type
903 swap(pair<_T1, _T2>&, pair<_T1, _T2>&) =
delete;
924#if __cplusplus >= 201103L
926 template<
typename _T1,
typename _T2>
927 constexpr pair<typename __decay_and_strip<_T1>::__type,
928 typename __decay_and_strip<_T2>::__type>
931 typedef typename __decay_and_strip<_T1>::__type __ds_type1;
932 typedef typename __decay_and_strip<_T2>::__type __ds_type2;
934 return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
937 template<
typename _T1,
typename _T2>
939 make_pair(_T1 __x, _T2 __y)
945#if __cplusplus >= 201103L
949 template<
typename _T1,
typename _T2>
950 struct __is_tuple_like_impl<pair<_T1, _T2>> :
true_type
955 template<
class _Tp1,
class _Tp2>
960 template<
class _Tp1,
class _Tp2>
962 {
typedef _Tp1 type; };
965 template<
class _Tp1,
class _Tp2>
967 {
typedef _Tp2 type; };
969#if __cplusplus >= 201703L
970 template<
typename _Tp1,
typename _Tp2>
971 inline constexpr size_t tuple_size_v<pair<_Tp1, _Tp2>> = 2;
973 template<
typename _Tp1,
typename _Tp2>
974 inline constexpr size_t tuple_size_v<const pair<_Tp1, _Tp2>> = 2;
976 template<
typename _Tp>
977 inline constexpr bool __is_pair =
false;
979 template<
typename _Tp,
typename _Up>
980 inline constexpr bool __is_pair<pair<_Tp, _Up>> =
true;
984 template<
size_t _Int>
990 template<
typename _Tp1,
typename _Tp2>
991 static constexpr _Tp1&
993 {
return __pair.first; }
995 template<
typename _Tp1,
typename _Tp2>
996 static constexpr _Tp1&&
997 __move_get(pair<_Tp1, _Tp2>&& __pair)
noexcept
998 {
return std::forward<_Tp1>(__pair.first); }
1000 template<
typename _Tp1,
typename _Tp2>
1001 static constexpr const _Tp1&
1002 __const_get(
const pair<_Tp1, _Tp2>& __pair)
noexcept
1003 {
return __pair.first; }
1005 template<
typename _Tp1,
typename _Tp2>
1006 static constexpr const _Tp1&&
1007 __const_move_get(
const pair<_Tp1, _Tp2>&& __pair)
noexcept
1008 {
return std::forward<const _Tp1>(__pair.first); }
1012 struct __pair_get<1>
1014 template<
typename _Tp1,
typename _Tp2>
1015 static constexpr _Tp2&
1016 __get(pair<_Tp1, _Tp2>& __pair)
noexcept
1017 {
return __pair.second; }
1019 template<
typename _Tp1,
typename _Tp2>
1020 static constexpr _Tp2&&
1021 __move_get(pair<_Tp1, _Tp2>&& __pair)
noexcept
1022 {
return std::forward<_Tp2>(__pair.second); }
1024 template<
typename _Tp1,
typename _Tp2>
1025 static constexpr const _Tp2&
1026 __const_get(
const pair<_Tp1, _Tp2>& __pair)
noexcept
1027 {
return __pair.second; }
1029 template<
typename _Tp1,
typename _Tp2>
1030 static constexpr const _Tp2&&
1031 __const_move_get(
const pair<_Tp1, _Tp2>&& __pair)
noexcept
1032 {
return std::forward<const _Tp2>(__pair.second); }
1040 template<
size_t _Int,
class _Tp1,
class _Tp2>
1041 constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&
1043 {
return __pair_get<_Int>::__get(__in); }
1045 template<
size_t _Int,
class _Tp1,
class _Tp2>
1046 constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&&
1048 {
return __pair_get<_Int>::__move_get(
std::move(__in)); }
1050 template<
size_t _Int,
class _Tp1,
class _Tp2>
1051 constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&
1053 {
return __pair_get<_Int>::__const_get(__in); }
1055 template<
size_t _Int,
class _Tp1,
class _Tp2>
1056 constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&&
1058 {
return __pair_get<_Int>::__const_move_get(
std::move(__in)); }
1061#ifdef __glibcxx_tuples_by_type
1062 template <
typename _Tp,
typename _Up>
1065 {
return __p.first; }
1067 template <
typename _Tp,
typename _Up>
1068 constexpr const _Tp&
1070 {
return __p.first; }
1072 template <
typename _Tp,
typename _Up>
1077 template <
typename _Tp,
typename _Up>
1078 constexpr const _Tp&&
1082 template <
typename _Tp,
typename _Up>
1085 {
return __p.second; }
1087 template <
typename _Tp,
typename _Up>
1088 constexpr const _Tp&
1090 {
return __p.second; }
1092 template <
typename _Tp,
typename _Up>
1097 template <
typename _Tp,
typename _Up>
1098 constexpr const _Tp&&
1104#if __glibcxx_ranges_zip
1105 template<
typename _T1,
typename _T2,
typename _U1,
typename _U2,
1106 template<
typename>
class _TQual,
template<
typename>
class _UQual>
1107 requires requires {
typename pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>,
1108 common_reference_t<_TQual<_T2>, _UQual<_U2>>>; }
1109 struct basic_common_reference<pair<_T1, _T2>, pair<_U1, _U2>, _TQual, _UQual>
1111 using type = pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>,
1112 common_reference_t<_TQual<_T2>, _UQual<_U2>>>;
1115 template<
typename _T1,
typename _T2,
typename _U1,
typename _U2>
1116 requires requires {
typename pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>; }
1117 struct common_type<pair<_T1, _T2>, pair<_U1, _U2>>
1118 {
using type = pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>; };
1124_GLIBCXX_END_NAMESPACE_VERSION
__bool_constant< true > true_type
The type used as a compile-time boolean with true value.
pair(_T1, _T2) -> pair< _T1, _T2 >
Two pairs of the same type are equal iff their members are equal.
constexpr bool operator>(const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
Uses operator< to find the result.
constexpr bool operator!=(const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
Uses operator== to find the result.
constexpr bool operator==(const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
Two pairs of the same type are equal iff their members are equal.
constexpr bool operator>=(const pair< _T1, _T2 > &__x, const pair< _T1, _T2 > &__y)
Uses operator< to find the result.
constexpr std::remove_reference< _Tp >::type && move(_Tp &&__t) noexcept
Convert a value to an rvalue.
constexpr enable_if< __and_< __is_swappable< _T1 >, __is_swappable< _T2 > >::value >::type swap(pair< _T1, _T2 > &__x, pair< _T1, _T2 > &__y) noexcept(noexcept(__x.swap(__y)))
constexpr piecewise_construct_t piecewise_construct
Tag for piecewise construction of std::pair objects.
constexpr pair< typename __decay_and_strip< _T1 >::__type, typename __decay_and_strip< _T2 >::__type > make_pair(_T1 &&__x, _T2 &&__y)
A convenience wrapper for creating a pair from two objects.
constexpr _Tp && forward(typename std::remove_reference< _Tp >::type &__t) noexcept
Forward an lvalue.
ISO C++ entities toplevel namespace is std.
Primary class template, tuple.
Define a member typedef type only if a boolean constant is true.
Struct holding two objects of arbitrary type.
constexpr pair(const _T1 &__a, const _T2 &__b)
Construct from two const lvalues, allowing implicit conversions.
_T1 first
The first member.
_T1 first_type
The type of the first member.
constexpr void swap(pair &__p) noexcept(__and_< __is_nothrow_swappable< _T1 >, __is_nothrow_swappable< _T2 > >::value)
Swap the first members and then the second members.
constexpr pair(const pair &)=default
Copy constructor.
_T2 second_type
The type of the second member.
constexpr pair(pair &&)=default
Move constructor.
_T2 second
The second member.
Tag type for piecewise construction of std::pair objects.
Finds the size of a given tuple type.
Gives the type of the ith element of a given tuple type.