aboutsummaryrefslogtreecommitdiff
path: root/contrib/llvm-project/libcxx/include/__compare/partial_order.h
diff options
context:
space:
mode:
authorDimitry Andric <dim@FreeBSD.org>2023-12-25 17:35:41 +0000
committerDimitry Andric <dim@FreeBSD.org>2024-04-06 20:13:06 +0000
commitcb14a3fe5122c879eae1fb480ed7ce82a699ddb6 (patch)
treeb983a613c35ece61d561b5a9ef9cd66419f6c7fb /contrib/llvm-project/libcxx/include/__compare/partial_order.h
parent3d68ee6cbdb244de9fab1df8a2525d2fa592571e (diff)
parent99aabd70801bd4bc72c4942747f6d62c675112f5 (diff)
Diffstat (limited to 'contrib/llvm-project/libcxx/include/__compare/partial_order.h')
-rw-r--r--contrib/llvm-project/libcxx/include/__compare/partial_order.h63
1 files changed, 32 insertions, 31 deletions
diff --git a/contrib/llvm-project/libcxx/include/__compare/partial_order.h b/contrib/llvm-project/libcxx/include/__compare/partial_order.h
index 36a11dfaa288..f3ed4900fbff 100644
--- a/contrib/llvm-project/libcxx/include/__compare/partial_order.h
+++ b/contrib/llvm-project/libcxx/include/__compare/partial_order.h
@@ -28,43 +28,44 @@ _LIBCPP_BEGIN_NAMESPACE_STD
// [cmp.alg]
namespace __partial_order {
- struct __fn {
- // NOLINTBEGIN(libcpp-robust-against-adl) partial_order should use ADL, but only here
- template<class _Tp, class _Up>
- requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
- _LIBCPP_HIDE_FROM_ABI static constexpr auto
- __go(_Tp&& __t, _Up&& __u, __priority_tag<2>)
- noexcept(noexcept(partial_ordering(partial_order(std::forward<_Tp>(__t), std::forward<_Up>(__u)))))
- -> decltype( partial_ordering(partial_order(std::forward<_Tp>(__t), std::forward<_Up>(__u))))
- { return partial_ordering(partial_order(std::forward<_Tp>(__t), std::forward<_Up>(__u))); }
- // NOLINTEND(libcpp-robust-against-adl)
+struct __fn {
+ // NOLINTBEGIN(libcpp-robust-against-adl) partial_order should use ADL, but only here
+ template <class _Tp, class _Up>
+ requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto __go(_Tp&& __t, _Up&& __u, __priority_tag<2>) noexcept(
+ noexcept(partial_ordering(partial_order(std::forward<_Tp>(__t), std::forward<_Up>(__u)))))
+ -> decltype(partial_ordering(partial_order(std::forward<_Tp>(__t), std::forward<_Up>(__u)))) {
+ return partial_ordering(partial_order(std::forward<_Tp>(__t), std::forward<_Up>(__u)));
+ }
+ // NOLINTEND(libcpp-robust-against-adl)
- template<class _Tp, class _Up>
- requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
- _LIBCPP_HIDE_FROM_ABI static constexpr auto
- __go(_Tp&& __t, _Up&& __u, __priority_tag<1>)
- noexcept(noexcept(partial_ordering(compare_three_way()(std::forward<_Tp>(__t), std::forward<_Up>(__u)))))
- -> decltype( partial_ordering(compare_three_way()(std::forward<_Tp>(__t), std::forward<_Up>(__u))))
- { return partial_ordering(compare_three_way()(std::forward<_Tp>(__t), std::forward<_Up>(__u))); }
+ template <class _Tp, class _Up>
+ requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto __go(_Tp&& __t, _Up&& __u, __priority_tag<1>) noexcept(
+ noexcept(partial_ordering(compare_three_way()(std::forward<_Tp>(__t), std::forward<_Up>(__u)))))
+ -> decltype(partial_ordering(compare_three_way()(std::forward<_Tp>(__t), std::forward<_Up>(__u)))) {
+ return partial_ordering(compare_three_way()(std::forward<_Tp>(__t), std::forward<_Up>(__u)));
+ }
- template<class _Tp, class _Up>
- requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
- _LIBCPP_HIDE_FROM_ABI static constexpr auto
- __go(_Tp&& __t, _Up&& __u, __priority_tag<0>)
- noexcept(noexcept(partial_ordering(std::weak_order(std::forward<_Tp>(__t), std::forward<_Up>(__u)))))
- -> decltype( partial_ordering(std::weak_order(std::forward<_Tp>(__t), std::forward<_Up>(__u))))
- { return partial_ordering(std::weak_order(std::forward<_Tp>(__t), std::forward<_Up>(__u))); }
+ template <class _Tp, class _Up>
+ requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
+ _LIBCPP_HIDE_FROM_ABI static constexpr auto __go(_Tp&& __t, _Up&& __u, __priority_tag<0>) noexcept(
+ noexcept(partial_ordering(std::weak_order(std::forward<_Tp>(__t), std::forward<_Up>(__u)))))
+ -> decltype(partial_ordering(std::weak_order(std::forward<_Tp>(__t), std::forward<_Up>(__u)))) {
+ return partial_ordering(std::weak_order(std::forward<_Tp>(__t), std::forward<_Up>(__u)));
+ }
- template<class _Tp, class _Up>
- _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
- noexcept(noexcept(__go(std::forward<_Tp>(__t), std::forward<_Up>(__u), __priority_tag<2>())))
- -> decltype( __go(std::forward<_Tp>(__t), std::forward<_Up>(__u), __priority_tag<2>()))
- { return __go(std::forward<_Tp>(__t), std::forward<_Up>(__u), __priority_tag<2>()); }
- };
+ template <class _Tp, class _Up>
+ _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
+ noexcept(noexcept(__go(std::forward<_Tp>(__t), std::forward<_Up>(__u), __priority_tag<2>())))
+ -> decltype(__go(std::forward<_Tp>(__t), std::forward<_Up>(__u), __priority_tag<2>())) {
+ return __go(std::forward<_Tp>(__t), std::forward<_Up>(__u), __priority_tag<2>());
+ }
+};
} // namespace __partial_order
inline namespace __cpo {
- inline constexpr auto partial_order = __partial_order::__fn{};
+inline constexpr auto partial_order = __partial_order::__fn{};
} // namespace __cpo
#endif // _LIBCPP_STD_VER >= 20