aboutsummaryrefslogtreecommitdiffstats
path: root/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h
diff options
context:
space:
mode:
authormikhnenko <mikhnenko@yandex-team.com>2024-03-27 10:35:27 +0300
committermikhnenko <mikhnenko@yandex-team.com>2024-03-27 10:47:39 +0300
commit9b902baa4a858f2176c82aa0b20f88232f0da0d8 (patch)
tree7165a551c2244c4b3c28479ac3a3f6d62346ec89 /contrib/libs/cxxsupp/libcxx/include/__utility/pair.h
parenta1c989e67e438005fa0c34ed0e910536c8941862 (diff)
downloadydb-9b902baa4a858f2176c82aa0b20f88232f0da0d8.tar.gz
Update libcxx to 10 Oct 2023 dc129d6f715cf83a2072fc8de8b4e4c70bca6935
97ce40d276e44357a49b7a945af841896126dca8
Diffstat (limited to 'contrib/libs/cxxsupp/libcxx/include/__utility/pair.h')
-rw-r--r--contrib/libs/cxxsupp/libcxx/include/__utility/pair.h47
1 files changed, 14 insertions, 33 deletions
diff --git a/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h b/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h
index 6b8c43dbe6..62dac6dd1d 100644
--- a/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h
+++ b/contrib/libs/cxxsupp/libcxx/include/__utility/pair.h
@@ -165,34 +165,28 @@ struct _LIBCPP_TEMPLATE_VIS pair
using _CheckArgsDep _LIBCPP_NODEBUG = typename conditional<
_MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
- template<bool _Dummy = true, typename enable_if<
- _CheckArgsDep<_Dummy>::__enable_explicit_default()
- >::type* = nullptr>
+ template<bool _Dummy = true, __enable_if_t<_CheckArgsDep<_Dummy>::__enable_explicit_default(), int> = 0>
explicit _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
is_nothrow_default_constructible<second_type>::value)
: first(), second() {}
- template<bool _Dummy = true, typename enable_if<
- _CheckArgsDep<_Dummy>::__enable_implicit_default()
- >::type* = nullptr>
+ template<bool _Dummy = true, __enable_if_t<_CheckArgsDep<_Dummy>::__enable_implicit_default(), int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR
pair() _NOEXCEPT_(is_nothrow_default_constructible<first_type>::value &&
is_nothrow_default_constructible<second_type>::value)
: first(), second() {}
- template <bool _Dummy = true, typename enable_if<
- _CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>()
- >::type* = nullptr>
+ template <bool _Dummy = true,
+ __enable_if_t<_CheckArgsDep<_Dummy>::template __enable_explicit<_T1 const&, _T2 const&>(), int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(_T1 const& __t1, _T2 const& __t2)
_NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
is_nothrow_copy_constructible<second_type>::value)
: first(__t1), second(__t2) {}
- template<bool _Dummy = true, typename enable_if<
- _CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>()
- >::type* = nullptr>
+ template<bool _Dummy = true,
+ __enable_if_t<_CheckArgsDep<_Dummy>::template __enable_implicit<_T1 const&, _T2 const&>(), int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(_T1 const& __t1, _T2 const& __t2)
_NOEXCEPT_(is_nothrow_copy_constructible<first_type>::value &&
@@ -205,7 +199,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
#else
class _U1, class _U2,
#endif
- typename enable_if<_CheckArgs::template __enable_explicit<_U1, _U2>()>::type* = nullptr
+ __enable_if_t<_CheckArgs::template __enable_explicit<_U1, _U2>(), int> = 0
>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(_U1&& __u1, _U2&& __u2)
@@ -219,7 +213,7 @@ struct _LIBCPP_TEMPLATE_VIS pair
#else
class _U1, class _U2,
#endif
- typename enable_if<_CheckArgs::template __enable_implicit<_U1, _U2>()>::type* = nullptr
+ __enable_if_t<_CheckArgs::template __enable_implicit<_U1, _U2>(), int> = 0
>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(_U1&& __u1, _U2&& __u2)
@@ -238,36 +232,28 @@ struct _LIBCPP_TEMPLATE_VIS pair
: first(__p.first), second(__p.second) {}
#endif
- template<class _U1, class _U2, typename enable_if<
- _CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>()
- >::type* = nullptr>
+ template<class _U1, class _U2, __enable_if_t<_CheckArgs::template __enable_explicit<_U1 const&, _U2 const&>(), int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(pair<_U1, _U2> const& __p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
is_nothrow_constructible<second_type, _U2 const&>::value))
: first(__p.first), second(__p.second) {}
- template<class _U1, class _U2, typename enable_if<
- _CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>()
- >::type* = nullptr>
+ template<class _U1, class _U2, __enable_if_t<_CheckArgs::template __enable_implicit<_U1 const&, _U2 const&>(), int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(pair<_U1, _U2> const& __p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
is_nothrow_constructible<second_type, _U2 const&>::value))
: first(__p.first), second(__p.second) {}
- template<class _U1, class _U2, typename enable_if<
- _CheckArgs::template __enable_explicit<_U1, _U2>()
- >::type* = nullptr>
+ template<class _U1, class _U2, __enable_if_t<_CheckArgs::template __enable_explicit<_U1, _U2>(), int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
explicit pair(pair<_U1, _U2>&&__p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
is_nothrow_constructible<second_type, _U2&&>::value))
: first(std::forward<_U1>(__p.first)), second(std::forward<_U2>(__p.second)) {}
- template<class _U1, class _U2, typename enable_if<
- _CheckArgs::template __enable_implicit<_U1, _U2>()
- >::type* = nullptr>
+ template<class _U1, class _U2, __enable_if_t<_CheckArgs::template __enable_implicit<_U1, _U2>(), int> = 0>
_LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
pair(pair<_U1, _U2>&& __p)
_NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
@@ -688,14 +674,9 @@ struct common_type<pair<_T1, _T2>, pair<_U1, _U2>> {
};
#endif // _LIBCPP_STD_VER >= 23
-template <class _T1, class _T2>
+template <class _T1, class _T2, __enable_if_t<__is_swappable<_T1>::value && __is_swappable<_T2>::value, int> = 0>
inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX20
-typename enable_if
-<
- __is_swappable<_T1>::value &&
- __is_swappable<_T2>::value,
- void
->::type
+void
swap(pair<_T1, _T2>& __x, pair<_T1, _T2>& __y)
_NOEXCEPT_((__is_nothrow_swappable<_T1>::value &&
__is_nothrow_swappable<_T2>::value))