[MLIR][TOSA] Update CustomOp input and output names (#118408)
[llvm-project.git] / libcxx / include / __compare / compare_weak_order_fallback.h
blob26689fbd9f445b82b36b843f58161d06ff151c1c
1 //===----------------------------------------------------------------------===//
2 //
3 // Part of the LLVM Project, under the Apache License v2.0 with LLVM Exceptions.
4 // See https://llvm.org/LICENSE.txt for license information.
5 // SPDX-License-Identifier: Apache-2.0 WITH LLVM-exception
6 //
7 //===----------------------------------------------------------------------===//
9 #ifndef _LIBCPP___COMPARE_COMPARE_WEAK_ORDER_FALLBACK
10 #define _LIBCPP___COMPARE_COMPARE_WEAK_ORDER_FALLBACK
12 #include <__compare/ordering.h>
13 #include <__compare/weak_order.h>
14 #include <__concepts/boolean_testable.h>
15 #include <__config>
16 #include <__type_traits/decay.h>
17 #include <__type_traits/is_same.h>
18 #include <__utility/forward.h>
19 #include <__utility/priority_tag.h>
21 #ifndef _LIBCPP_HAS_NO_PRAGMA_SYSTEM_HEADER
22 # pragma GCC system_header
23 #endif
25 _LIBCPP_BEGIN_NAMESPACE_STD
27 #if _LIBCPP_STD_VER >= 20
29 // [cmp.alg]
30 namespace __compare_weak_order_fallback {
31 struct __fn {
32 template <class _Tp, class _Up>
33 requires is_same_v<decay_t<_Tp>, decay_t<_Up>>
34 _LIBCPP_HIDE_FROM_ABI static constexpr auto __go(_Tp&& __t, _Up&& __u, __priority_tag<1>) noexcept(
35 noexcept(std::weak_order(std::forward<_Tp>(__t), std::forward<_Up>(__u))))
36 -> decltype(std::weak_order(std::forward<_Tp>(__t), std::forward<_Up>(__u))) {
37 return std::weak_order(std::forward<_Tp>(__t), std::forward<_Up>(__u));
40 template <class _Tp, class _Up>
41 requires is_same_v<decay_t<_Tp>, decay_t<_Up>> && requires(_Tp&& __t, _Up&& __u) {
42 { std::forward<_Tp>(__t) == std::forward<_Up>(__u) } -> __boolean_testable;
43 { std::forward<_Tp>(__t) < std::forward<_Up>(__u) } -> __boolean_testable;
45 _LIBCPP_HIDE_FROM_ABI static constexpr weak_ordering __go(_Tp&& __t, _Up&& __u, __priority_tag<0>) noexcept(noexcept(
46 std::forward<_Tp>(__t) == std::forward<_Up>(__u) ? weak_ordering::equivalent
47 : std::forward<_Tp>(__t) < std::forward<_Up>(__u)
48 ? weak_ordering::less
49 : weak_ordering::greater)) {
50 return std::forward<_Tp>(__t) == std::forward<_Up>(__u) ? weak_ordering::equivalent
51 : std::forward<_Tp>(__t) < std::forward<_Up>(__u)
52 ? weak_ordering::less
53 : weak_ordering::greater;
56 template <class _Tp, class _Up>
57 _LIBCPP_HIDE_FROM_ABI constexpr auto operator()(_Tp&& __t, _Up&& __u) const
58 noexcept(noexcept(__go(std::forward<_Tp>(__t), std::forward<_Up>(__u), __priority_tag<1>())))
59 -> decltype(__go(std::forward<_Tp>(__t), std::forward<_Up>(__u), __priority_tag<1>())) {
60 return __go(std::forward<_Tp>(__t), std::forward<_Up>(__u), __priority_tag<1>());
63 } // namespace __compare_weak_order_fallback
65 inline namespace __cpo {
66 inline constexpr auto compare_weak_order_fallback = __compare_weak_order_fallback::__fn{};
67 } // namespace __cpo
69 #endif // _LIBCPP_STD_VER >= 20
71 _LIBCPP_END_NAMESPACE_STD
73 #endif // _LIBCPP___COMPARE_COMPARE_WEAK_ORDER_FALLBACK