59#if __cplusplus >= 201103L
64#if __cplusplus >= 202002L
66# define __cpp_lib_constexpr_utility 201811L
69namespace std _GLIBCXX_VISIBILITY(default)
71_GLIBCXX_BEGIN_NAMESPACE_VERSION
78#if __cplusplus >= 201103L
95#if ! __cpp_lib_concepts
101 template <
bool,
typename _T1,
typename _T2>
104 template <
typename _U1,
typename _U2>
105 static constexpr bool _ConstructiblePair()
107 return __and_<is_constructible<_T1, const _U1&>,
111 template <
typename _U1,
typename _U2>
112 static constexpr bool _ImplicitlyConvertiblePair()
114 return __and_<is_convertible<const _U1&, _T1>,
115 is_convertible<const _U2&, _T2>>::value;
118 template <
typename _U1,
typename _U2>
119 static constexpr bool _MoveConstructiblePair()
121 return __and_<is_constructible<_T1, _U1&&>,
122 is_constructible<_T2, _U2&&>>::value;
125 template <
typename _U1,
typename _U2>
126 static constexpr bool _ImplicitlyMoveConvertiblePair()
128 return __and_<is_convertible<_U1&&, _T1>,
129 is_convertible<_U2&&, _T2>>::value;
133 template <
typename _T1,
typename _T2>
134 struct _PCC<false, _T1, _T2>
136 template <
typename _U1,
typename _U2>
137 static constexpr bool _ConstructiblePair()
142 template <
typename _U1,
typename _U2>
143 static constexpr bool _ImplicitlyConvertiblePair()
148 template <
typename _U1,
typename _U2>
149 static constexpr bool _MoveConstructiblePair()
154 template <
typename _U1,
typename _U2>
155 static constexpr bool _ImplicitlyMoveConvertiblePair()
163 template<
typename _U1,
typename _U2>
class __pair_base
165#if __cplusplus >= 201103L && ! __cpp_lib_concepts
166 template<
typename _T1,
typename _T2>
friend struct pair;
167 __pair_base() =
default;
168 ~__pair_base() =
default;
169 __pair_base(
const __pair_base&) =
default;
170 __pair_base& operator=(
const __pair_base&) =
delete;
186 template<
typename _T1,
typename _T2>
188 :
public __pair_base<_T1, _T2>
196#if __cplusplus >= 201103L
200 template<
typename... _Args1,
typename... _Args2>
205 _GLIBCXX20_CONSTEXPR
void
207 noexcept(__and_<__is_nothrow_swappable<_T1>,
208 __is_nothrow_swappable<_T2>>::value)
215#if __cplusplus > 202002L
223 swap(
const pair& __p)
const
224 noexcept(__and_v<__is_nothrow_swappable<const _T1>,
225 __is_nothrow_swappable<const _T2>>)
226 requires is_swappable_v<const _T1> && is_swappable_v<const _T2>
229 swap(
first, __p.first);
235 template<
typename... _Args1,
size_t... _Indexes1,
236 typename... _Args2,
size_t... _Indexes2>
238 pair(tuple<_Args1...>&, tuple<_Args2...>&,
239 _Index_tuple<_Indexes1...>, _Index_tuple<_Indexes2...>);
242#if __cpp_lib_concepts
247 explicit(__not_<__and_<__is_implicitly_default_constructible<_T1>,
248 __is_implicitly_default_constructible<_T2>>>())
250 requires is_default_constructible_v<_T1>
251 && is_default_constructible_v<_T2>
258 template<
typename _U1,
typename _U2>
259 static constexpr bool
262 if constexpr (is_constructible_v<_T1, _U1>)
263 return is_constructible_v<_T2, _U2>;
267 template<
typename _U1,
typename _U2>
268 static constexpr bool
269 _S_nothrow_constructible()
271 if constexpr (is_nothrow_constructible_v<_T1, _U1>)
272 return is_nothrow_constructible_v<_T2, _U2>;
276 template<
typename _U1,
typename _U2>
277 static constexpr bool
280 if constexpr (is_convertible_v<_U1, _T1>)
281 return is_convertible_v<_U2, _T2>;
286 template<
typename _U1,
typename _U2>
287 static constexpr bool
290#if __has_builtin(__reference_constructs_from_temporary)
291 if constexpr (__reference_constructs_from_temporary(_T1, _U1&&))
294 return __reference_constructs_from_temporary(_T2, _U2&&);
304 constexpr explicit(!_S_convertible<const _T1&, const _T2&>())
305 pair(
const _T1& __x,
const _T2& __y)
306 noexcept(_S_nothrow_constructible<const _T1&, const _T2&>())
307 requires (_S_constructible<const _T1&, const _T2&>())
312 template<
typename _U1,
typename _U2>
313 requires (_S_constructible<_U1, _U2>()) && (!_S_dangles<_U1, _U2>())
314 constexpr explicit(!_S_convertible<_U1, _U2>())
315 pair(_U1&& __x, _U2&& __y)
316 noexcept(_S_nothrow_constructible<_U1, _U2>())
320 template<
typename _U1,
typename _U2>
321 requires (_S_constructible<_U1, _U2>()) && (_S_dangles<_U1, _U2>())
322 constexpr explicit(!_S_convertible<_U1, _U2>())
323 pair(_U1&&, _U2&&) =
delete;
326 template<
typename _U1,
typename _U2>
327 requires (_S_constructible<const _U1&, const _U2&>())
328 && (!_S_dangles<_U1, _U2>())
329 constexpr explicit(!_S_convertible<const _U1&, const _U2&>())
330 pair(
const pair<_U1, _U2>& __p)
331 noexcept(_S_nothrow_constructible<const _U1&, const _U2&>())
335 template<
typename _U1,
typename _U2>
336 requires (_S_constructible<const _U1&, const _U2&>())
337 && (_S_dangles<const _U1&, const _U2&>())
338 constexpr explicit(!_S_convertible<const _U1&, const _U2&>())
339 pair(
const pair<_U1, _U2>&) =
delete;
342 template<
typename _U1,
typename _U2>
343 requires (_S_constructible<_U1, _U2>()) && (!_S_dangles<_U1, _U2>())
344 constexpr explicit(!_S_convertible<_U1, _U2>())
345 pair(pair<_U1, _U2>&& __p)
346 noexcept(_S_nothrow_constructible<_U1, _U2>())
351 template<
typename _U1,
typename _U2>
352 requires (_S_constructible<_U1, _U2>()) && (_S_dangles<_U1, _U2>())
353 constexpr explicit(!_S_convertible<_U1, _U2>())
354 pair(pair<_U1, _U2>&&) =
delete;
356#if __cplusplus > 202002L
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>& __p)
362 noexcept(_S_nothrow_constructible<_U1&, _U2&>())
366 template<
typename _U1,
typename _U2>
367 requires (_S_constructible<_U1&, _U2&>()) && (_S_dangles<_U1&, _U2&>())
368 constexpr explicit(!_S_convertible<_U1&, _U2&>())
369 pair(pair<_U1, _U2>&) =
delete;
372 template<
typename _U1,
typename _U2>
373 requires (_S_constructible<const _U1, const _U2>())
374 && (!_S_dangles<const _U1, const _U2>())
375 constexpr explicit(!_S_convertible<const _U1, const _U2>())
376 pair(
const pair<_U1, _U2>&& __p)
377 noexcept(_S_nothrow_constructible<const _U1, const _U2>())
382 template<
typename _U1,
typename _U2>
383 requires (_S_constructible<const _U1, const _U2>())
384 && (_S_dangles<const _U1, const _U2>())
385 constexpr explicit(!_S_convertible<const _U1, const _U2>())
386 pair(
const pair<_U1, _U2>&&) =
delete;
391 template<
typename _U1,
typename _U2>
392 static constexpr bool
395 if constexpr (is_assignable_v<_T1&, _U1>)
396 return is_assignable_v<_T2&, _U2>;
400 template<
typename _U1,
typename _U2>
401 static constexpr bool
402 _S_nothrow_assignable()
404 if constexpr (is_nothrow_assignable_v<_T1&, _U1>)
405 return is_nothrow_assignable_v<_T2&, _U2>;
412 pair& operator=(
const pair&) =
delete;
416 operator=(
const pair& __p)
417 noexcept(_S_nothrow_assignable<const _T1&, const _T2&>())
418 requires (_S_assignable<const _T1&, const _T2&>())
427 operator=(
pair&& __p)
428 noexcept(_S_nothrow_assignable<_T1, _T2>())
429 requires (_S_assignable<_T1, _T2>())
431 first = std::forward<first_type>(__p.first);
432 second = std::forward<second_type>(__p.second);
437 template<
typename _U1,
typename _U2>
439 operator=(
const pair<_U1, _U2>& __p)
440 noexcept(_S_nothrow_assignable<const _U1&, const _U2&>())
441 requires (_S_assignable<const _U1&, const _U2&>())
449 template<
typename _U1,
typename _U2>
451 operator=(pair<_U1, _U2>&& __p)
452 noexcept(_S_nothrow_assignable<_U1, _U2>())
453 requires (_S_assignable<_U1, _U2>())
455 first = std::forward<_U1>(__p.first);
456 second = std::forward<_U2>(__p.second);
460#if __cplusplus > 202002L
462 constexpr const pair&
463 operator=(
const pair& __p)
const
464 requires is_copy_assignable_v<const first_type>
465 && is_copy_assignable_v<const second_type>
473 constexpr const pair&
474 operator=(
pair&& __p)
const
475 requires is_assignable_v<const first_type&, first_type>
476 && is_assignable_v<const second_type&, second_type>
478 first = std::forward<first_type>(__p.first);
479 second = std::forward<second_type>(__p.second);
484 template<
typename _U1,
typename _U2>
485 constexpr const pair&
486 operator=(
const pair<_U1, _U2>& __p)
const
487 requires is_assignable_v<const first_type&, const _U1&>
488 && is_assignable_v<const second_type&, const _U2&>
496 template<
typename _U1,
typename _U2>
497 constexpr const pair&
498 operator=(pair<_U1, _U2>&& __p)
const
499 requires is_assignable_v<const first_type&, _U1>
500 && is_assignable_v<const second_type&, _U2>
502 first = std::forward<_U1>(__p.first);
503 second = std::forward<_U2>(__p.second);
512#if __has_builtin(__reference_constructs_from_temporary) \
513 && defined _GLIBCXX_DEBUG
514# define __glibcxx_no_dangling_refs(_U1, _U2) \
515 static_assert(!__reference_constructs_from_temporary(_T1, _U1) \
516 && !__reference_constructs_from_temporary(_T2, _U2), \
517 "std::pair constructor creates a dangling reference")
519# define __glibcxx_no_dangling_refs(_U1, _U2)
525 template <
typename _U1 = _T1,
527 typename enable_if<__and_<
528 __is_implicitly_default_constructible<_U1>,
529 __is_implicitly_default_constructible<_U2>>
530 ::value,
bool>::type =
true>
534 template <
typename _U1 = _T1,
540 __and_<__is_implicitly_default_constructible<_U1>,
541 __is_implicitly_default_constructible<_U2>>>>
542 ::value,
bool>::type =
false>
543 explicit constexpr pair()
548 using _PCCP = _PCC<true, _T1, _T2>;
552 template<
typename _U1 = _T1,
typename _U2=_T2,
typename
553 enable_if<_PCCP::template
554 _ConstructiblePair<_U1, _U2>()
556 _ImplicitlyConvertiblePair<_U1, _U2>(),
558 constexpr pair(
const _T1& __a,
const _T2& __b)
562 template<
typename _U1 = _T1,
typename _U2=_T2,
typename
564 _ConstructiblePair<_U1, _U2>()
566 _ImplicitlyConvertiblePair<_U1, _U2>(),
568 explicit constexpr pair(
const _T1& __a,
const _T2& __b)
573 template <
typename _U1,
typename _U2>
574 using _PCCFP = _PCC<!is_same<_T1, _U1>::value
579 template<
typename _U1,
typename _U2,
typename
581 _ConstructiblePair<_U1, _U2>()
582 && _PCCFP<_U1, _U2>::template
583 _ImplicitlyConvertiblePair<_U1, _U2>(),
587 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
589 template<
typename _U1,
typename _U2,
typename
590 enable_if<_PCCFP<_U1, _U2>::template
591 _ConstructiblePair<_U1, _U2>()
592 && !_PCCFP<_U1, _U2>::template
593 _ImplicitlyConvertiblePair<_U1, _U2>(),
595 explicit constexpr pair(
const pair<_U1, _U2>& __p)
597 { __glibcxx_no_dangling_refs(
const _U1&,
const _U2&); }
599#if _GLIBCXX_USE_DEPRECATED
600#if defined(__DEPRECATED)
601# define _GLIBCXX_DEPRECATED_PAIR_CTOR \
602 __attribute__ ((__deprecated__ ("use 'nullptr' instead of '0' to " \
603 "initialize std::pair of move-only " \
604 "type and pointer")))
606# define _GLIBCXX_DEPRECATED_PAIR_CTOR
613 struct __zero_as_null_pointer_constant
615 __zero_as_null_pointer_constant(
int __zero_as_null_pointer_constant::*)
617 template<
typename _Tp,
618 typename = __enable_if_t<is_null_pointer<_Tp>::value>>
619 __zero_as_null_pointer_constant(_Tp) =
delete;
627 template<
typename _U1,
628 __enable_if_t<__and_<__not_<is_reference<_U1>>,
630 is_constructible<_T1, _U1>,
631 __not_<is_constructible<_T1, const _U1&>>,
632 is_convertible<_U1, _T1>>::value,
634 _GLIBCXX_DEPRECATED_PAIR_CTOR
636 pair(_U1&& __x, __zero_as_null_pointer_constant, ...)
638 { __glibcxx_no_dangling_refs(_U1&&, std::nullptr_t); }
640 template<
typename _U1,
641 __enable_if_t<__and_<__not_<is_reference<_U1>>,
643 is_constructible<_T1, _U1>,
644 __not_<is_constructible<_T1, const _U1&>>,
645 __not_<is_convertible<_U1, _T1>>>::value,
647 _GLIBCXX_DEPRECATED_PAIR_CTOR
649 pair(_U1&& __x, __zero_as_null_pointer_constant, ...)
651 { __glibcxx_no_dangling_refs(_U1&&, std::nullptr_t); }
653 template<
typename _U2,
654 __enable_if_t<__and_<is_pointer<_T1>,
655 __not_<is_reference<_U2>>,
656 is_constructible<_T2, _U2>,
657 __not_<is_constructible<_T2, const _U2&>>,
658 is_convertible<_U2, _T2>>::value,
660 _GLIBCXX_DEPRECATED_PAIR_CTOR
662 pair(__zero_as_null_pointer_constant, _U2&& __y, ...)
664 { __glibcxx_no_dangling_refs(std::nullptr_t, _U2&&); }
666 template<
typename _U2,
667 __enable_if_t<__and_<is_pointer<_T1>,
668 __not_<is_reference<_U2>>,
669 is_constructible<_T2, _U2>,
670 __not_<is_constructible<_T2, const _U2&>>,
671 __not_<is_convertible<_U2, _T2>>>::value,
673 _GLIBCXX_DEPRECATED_PAIR_CTOR
675 pair(__zero_as_null_pointer_constant, _U2&& __y, ...)
677 { __glibcxx_no_dangling_refs(std::nullptr_t, _U2&&); }
678#undef _GLIBCXX_DEPRECATED_PAIR_CTOR
681 template<
typename _U1,
typename _U2,
typename
682 enable_if<_PCCP::template
683 _MoveConstructiblePair<_U1, _U2>()
685 _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
687 constexpr pair(_U1&& __x, _U2&& __y)
689 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
691 template<
typename _U1,
typename _U2,
typename
692 enable_if<_PCCP::template
693 _MoveConstructiblePair<_U1, _U2>()
695 _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
697 explicit constexpr pair(_U1&& __x, _U2&& __y)
699 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
702 template<
typename _U1,
typename _U2,
typename
703 enable_if<_PCCFP<_U1, _U2>::template
704 _MoveConstructiblePair<_U1, _U2>()
705 && _PCCFP<_U1, _U2>::template
706 _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
708 constexpr pair(pair<_U1, _U2>&& __p)
711 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
713 template<
typename _U1,
typename _U2,
typename
714 enable_if<_PCCFP<_U1, _U2>::template
715 _MoveConstructiblePair<_U1, _U2>()
716 && !_PCCFP<_U1, _U2>::template
717 _ImplicitlyMoveConvertiblePair<_U1, _U2>(),
719 explicit constexpr pair(pair<_U1, _U2>&& __p)
722 { __glibcxx_no_dangling_refs(_U1&&, _U2&&); }
724#undef __glibcxx_no_dangling_refs
727 operator=(__conditional_t<__and_<is_copy_assignable<_T1>,
728 is_copy_assignable<_T2>>::value,
729 const pair&,
const __nonesuch&> __p)
737 operator=(__conditional_t<__and_<is_move_assignable<_T1>,
738 is_move_assignable<_T2>>::value,
739 pair&&, __nonesuch&&> __p)
740 noexcept(__and_<is_nothrow_move_assignable<_T1>,
741 is_nothrow_move_assignable<_T2>>::value)
743 first = std::forward<first_type>(__p.first);
744 second = std::forward<second_type>(__p.second);
748 template<
typename _U1,
typename _U2>
749 typename enable_if<__and_<is_assignable<_T1&, const _U1&>,
750 is_assignable<_T2&, const _U2&>>::value,
752 operator=(
const pair<_U1, _U2>& __p)
759 template<
typename _U1,
typename _U2>
760 typename enable_if<__and_<is_assignable<_T1&, _U1&&>,
761 is_assignable<_T2&, _U2&&>>::value,
763 operator=(pair<_U1, _U2>&& __p)
765 first = std::forward<_U1>(__p.first);
766 second = std::forward<_U2>(__p.second);
780 pair(
const _T1& __a,
const _T2& __b)
784 template<
typename _U1,
typename _U2>
785 pair(
const pair<_U1, _U2>& __p)
788#if __has_builtin(__reference_constructs_from_temporary)
789#pragma GCC diagnostic push
790#pragma GCC diagnostic ignored "-Wunused-local-typedefs"
791 typedef int _DanglingCheck1[
792 __reference_constructs_from_temporary(_T1,
const _U1&) ? -1 : 1
794 typedef int _DanglingCheck2[
795 __reference_constructs_from_temporary(_T2,
const _U2&) ? -1 : 1
797#pragma GCC diagnostic pop
805#if __cpp_deduction_guides >= 201606
810 template<
typename _T1,
typename _T2>
811 inline _GLIBCXX_CONSTEXPR
bool
815#if __cpp_lib_three_way_comparison && __cpp_lib_concepts
816 template<
typename _T1,
typename _T2>
817 constexpr common_comparison_category_t<__detail::__synth3way_t<_T1>,
818 __detail::__synth3way_t<_T2>>
821 if (
auto __c = __detail::__synth3way(__x.
first, __y.
first); __c != 0)
833 template<
typename _T1,
typename _T2>
834 inline _GLIBCXX_CONSTEXPR
bool
840 template<
typename _T1,
typename _T2>
841 inline _GLIBCXX_CONSTEXPR
bool
843 {
return !(__x == __y); }
846 template<
typename _T1,
typename _T2>
847 inline _GLIBCXX_CONSTEXPR
bool
849 {
return __y < __x; }
852 template<
typename _T1,
typename _T2>
853 inline _GLIBCXX_CONSTEXPR
bool
855 {
return !(__y < __x); }
858 template<
typename _T1,
typename _T2>
859 inline _GLIBCXX_CONSTEXPR
bool
861 {
return !(__x < __y); }
864#if __cplusplus >= 201103L
870 template<
typename _T1,
typename _T2>
871 _GLIBCXX20_CONSTEXPR
inline
872#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
875 __is_swappable<_T2>>::value>::type
880 noexcept(
noexcept(__x.
swap(__y)))
883#if __cplusplus > 202002L
884 template<
typename _T1,
typename _T2>
885 requires is_swappable_v<const _T1> && is_swappable_v<const _T2>
888 noexcept(
noexcept(__x.
swap(__y)))
892#if __cplusplus > 201402L || !defined(__STRICT_ANSI__)
893 template<
typename _T1,
typename _T2>
894 typename enable_if<!__and_<__is_swappable<_T1>,
895 __is_swappable<_T2>>::value>::type
896 swap(pair<_T1, _T2>&, pair<_T1, _T2>&) =
delete;
917#if __cplusplus >= 201103L
919 template<
typename _T1,
typename _T2>
920 constexpr pair<typename __decay_and_strip<_T1>::__type,
921 typename __decay_and_strip<_T2>::__type>
924 typedef typename __decay_and_strip<_T1>::__type __ds_type1;
925 typedef typename __decay_and_strip<_T2>::__type __ds_type2;
927 return __pair_type(std::forward<_T1>(__x), std::forward<_T2>(__y));
930 template<
typename _T1,
typename _T2>
932 make_pair(_T1 __x, _T2 __y)
938#if __cplusplus >= 201103L
942 template<
typename _T1,
typename _T2>
943 struct __is_tuple_like_impl<pair<_T1, _T2>> :
true_type
948 template<
class _Tp1,
class _Tp2>
953 template<
class _Tp1,
class _Tp2>
955 {
typedef _Tp1 type; };
958 template<
class _Tp1,
class _Tp2>
960 {
typedef _Tp2 type; };
962#if __cplusplus >= 201703L
963 template<
typename _Tp1,
typename _Tp2>
964 inline constexpr size_t tuple_size_v<pair<_Tp1, _Tp2>> = 2;
966 template<
typename _Tp1,
typename _Tp2>
967 inline constexpr size_t tuple_size_v<const pair<_Tp1, _Tp2>> = 2;
969 template<
typename _Tp>
970 inline constexpr bool __is_pair =
false;
972 template<
typename _Tp,
typename _Up>
973 inline constexpr bool __is_pair<pair<_Tp, _Up>> =
true;
977 template<
size_t _Int>
983 template<
typename _Tp1,
typename _Tp2>
984 static constexpr _Tp1&
986 {
return __pair.first; }
988 template<
typename _Tp1,
typename _Tp2>
989 static constexpr _Tp1&&
990 __move_get(pair<_Tp1, _Tp2>&& __pair)
noexcept
991 {
return std::forward<_Tp1>(__pair.first); }
993 template<
typename _Tp1,
typename _Tp2>
994 static constexpr const _Tp1&
995 __const_get(
const pair<_Tp1, _Tp2>& __pair)
noexcept
996 {
return __pair.first; }
998 template<
typename _Tp1,
typename _Tp2>
999 static constexpr const _Tp1&&
1000 __const_move_get(
const pair<_Tp1, _Tp2>&& __pair)
noexcept
1001 {
return std::forward<const _Tp1>(__pair.first); }
1005 struct __pair_get<1>
1007 template<
typename _Tp1,
typename _Tp2>
1008 static constexpr _Tp2&
1009 __get(pair<_Tp1, _Tp2>& __pair)
noexcept
1010 {
return __pair.second; }
1012 template<
typename _Tp1,
typename _Tp2>
1013 static constexpr _Tp2&&
1014 __move_get(pair<_Tp1, _Tp2>&& __pair)
noexcept
1015 {
return std::forward<_Tp2>(__pair.second); }
1017 template<
typename _Tp1,
typename _Tp2>
1018 static constexpr const _Tp2&
1019 __const_get(
const pair<_Tp1, _Tp2>& __pair)
noexcept
1020 {
return __pair.second; }
1022 template<
typename _Tp1,
typename _Tp2>
1023 static constexpr const _Tp2&&
1024 __const_move_get(
const pair<_Tp1, _Tp2>&& __pair)
noexcept
1025 {
return std::forward<const _Tp2>(__pair.second); }
1033 template<
size_t _Int,
class _Tp1,
class _Tp2>
1034 constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&
1036 {
return __pair_get<_Int>::__get(__in); }
1038 template<
size_t _Int,
class _Tp1,
class _Tp2>
1039 constexpr typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&&
1041 {
return __pair_get<_Int>::__move_get(
std::move(__in)); }
1043 template<
size_t _Int,
class _Tp1,
class _Tp2>
1044 constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&
1046 {
return __pair_get<_Int>::__const_get(__in); }
1048 template<
size_t _Int,
class _Tp1,
class _Tp2>
1049 constexpr const typename tuple_element<_Int, pair<_Tp1, _Tp2>>::type&&
1051 {
return __pair_get<_Int>::__const_move_get(
std::move(__in)); }
1053#if __cplusplus >= 201402L
1055#define __cpp_lib_tuples_by_type 201304L
1057 template <
typename _Tp,
typename _Up>
1060 {
return __p.first; }
1062 template <
typename _Tp,
typename _Up>
1063 constexpr const _Tp&
1065 {
return __p.first; }
1067 template <
typename _Tp,
typename _Up>
1072 template <
typename _Tp,
typename _Up>
1073 constexpr const _Tp&&
1077 template <
typename _Tp,
typename _Up>
1080 {
return __p.second; }
1082 template <
typename _Tp,
typename _Up>
1083 constexpr const _Tp&
1085 {
return __p.second; }
1087 template <
typename _Tp,
typename _Up>
1092 template <
typename _Tp,
typename _Up>
1093 constexpr const _Tp&&
1097#if __cplusplus > 202002L
1098 template<
typename _T1,
typename _T2,
typename _U1,
typename _U2,
1099 template<
typename>
class _TQual,
template<
typename>
class _UQual>
1100 requires requires {
typename pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>,
1101 common_reference_t<_TQual<_T2>, _UQual<_U2>>>; }
1102 struct basic_common_reference<pair<_T1, _T2>, pair<_U1, _U2>, _TQual, _UQual>
1104 using type = pair<common_reference_t<_TQual<_T1>, _UQual<_U1>>,
1105 common_reference_t<_TQual<_T2>, _UQual<_U2>>>;
1108 template<
typename _T1,
typename _T2,
typename _U1,
typename _U2>
1109 requires requires {
typename pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>; }
1110 struct common_type<pair<_T1, _T2>, pair<_U1, _U2>>
1111 {
using type = pair<common_type_t<_T1, _U1>, common_type_t<_T2, _U2>>; };
1118_GLIBCXX_END_NAMESPACE_VERSION
integral_constant< bool, 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.
void swap(any &__x, any &__y) noexcept
Exchange the states of two any 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.