[libcxx-commits] [libcxx] [libc++][NFC] Format pair.h (PR #94101)
via libcxx-commits
libcxx-commits at lists.llvm.org
Fri May 31 23:56:19 PDT 2024
llvmbot wrote:
<!--LLVM PR SUMMARY COMMENT-->
@llvm/pr-subscribers-libcxx
Author: Nikolas Klauser (philnik777)
<details>
<summary>Changes</summary>
---
Full diff: https://github.com/llvm/llvm-project/pull/94101.diff
1 Files Affected:
- (modified) libcxx/include/__utility/pair.h (+19-18)
``````````diff
diff --git a/libcxx/include/__utility/pair.h b/libcxx/include/__utility/pair.h
index e05250ba05717..3ffab2f7fe4f6 100644
--- a/libcxx/include/__utility/pair.h
+++ b/libcxx/include/__utility/pair.h
@@ -129,9 +129,9 @@ struct _LIBCPP_TEMPLATE_VIS pair
typename conditional< _MaybeEnable, _CheckArgs, __check_tuple_constructor_fail>::type;
template <bool _Dummy = true, __enable_if_t<_CheckArgsDep<_Dummy>::__enable_default(), int> = 0>
- explicit(!_CheckArgsDep<_Dummy>::__enable_implicit_default()) _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR pair()
- _NOEXCEPT_(
- is_nothrow_default_constructible<first_type>::value&& is_nothrow_default_constructible<second_type>::value)
+ explicit(!_CheckArgsDep<_Dummy>::__enable_implicit_default()) _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,
@@ -150,10 +150,10 @@ struct _LIBCPP_TEMPLATE_VIS pair
class _U2,
# endif
__enable_if_t<_CheckArgs::template __is_pair_constructible<_U1, _U2>(), int> = 0 >
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>())
- pair(_U1&& __u1, _U2&& __u2)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
- is_nothrow_constructible<second_type, _U2>::value))
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>()) pair(_U1&& __u1, _U2&& __u2)
+ _NOEXCEPT_((is_nothrow_constructible<first_type, _U1>::value &&
+ is_nothrow_constructible<second_type, _U2>::value))
: first(std::forward<_U1>(__u1)), second(std::forward<_U2>(__u2)) {
}
@@ -168,17 +168,18 @@ struct _LIBCPP_TEMPLATE_VIS pair
template <class _U1,
class _U2,
__enable_if_t<_CheckArgs::template __is_pair_constructible<_U1 const&, _U2 const&>(), int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(
- !_CheckArgs::template __is_implicit<_U1 const&, _U2 const&>()) pair(pair<_U1, _U2> const& __p)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _U1 const&>::value &&
- is_nothrow_constructible<second_type, _U2 const&>::value))
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1 const&, _U2 const&>())
+ 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, __enable_if_t<_CheckArgs::template __is_pair_constructible<_U1, _U2>(), int> = 0>
- _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>())
- pair(pair<_U1, _U2>&& __p)
- _NOEXCEPT_((is_nothrow_constructible<first_type, _U1&&>::value &&
- is_nothrow_constructible<second_type, _U2&&>::value))
+ _LIBCPP_HIDE_FROM_ABI
+ _LIBCPP_CONSTEXPR_SINCE_CXX14 explicit(!_CheckArgs::template __is_implicit<_U1, _U2>()) 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)) {}
# if _LIBCPP_STD_VER >= 23
@@ -528,9 +529,9 @@ swap(const pair<_T1, _T2>& __x, const pair<_T1, _T2>& __y) noexcept(noexcept(__x
#endif
template <class _T1, class _T2>
-inline _LIBCPP_HIDE_FROM_ABI _LIBCPP_CONSTEXPR_SINCE_CXX14
- pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
- make_pair(_T1&& __t1, _T2&& __t2) {
+inline _LIBCPP_HIDE_FROM_ABI
+_LIBCPP_CONSTEXPR_SINCE_CXX14 pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>
+make_pair(_T1&& __t1, _T2&& __t2) {
return pair<typename __unwrap_ref_decay<_T1>::type, typename __unwrap_ref_decay<_T2>::type>(
std::forward<_T1>(__t1), std::forward<_T2>(__t2));
}
``````````
</details>
https://github.com/llvm/llvm-project/pull/94101
More information about the libcxx-commits
mailing list