31 #define _RANGES_CMP_H 1 33 #if __cplusplus > 201703L 37 namespace std _GLIBCXX_VISIBILITY(default)
39 _GLIBCXX_BEGIN_NAMESPACE_VERSION
41 struct __is_transparent;
49 template<
typename _Tp>
52 operator()(_Tp&& __t)
const noexcept
53 {
return std::forward<_Tp>(__t); }
55 using is_transparent = __is_transparent;
58 #ifdef __glibcxx_ranges // C++ >= 20 66 template<
typename _Tp,
typename _Up>
67 concept __less_builtin_ptr_cmp
68 = requires (_Tp&& __t, _Up&& __u) { { __t < __u } -> same_as<bool>; }
69 && convertible_to<_Tp, const volatile void*>
70 && convertible_to<_Up, const volatile void*>
71 && ! requires(_Tp&& __t, _Up&& __u)
72 { operator<(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
73 && ! requires(_Tp&& __t, _Up&& __u)
74 { std::forward<_Tp>(__t).
operator<(std::forward<_Up>(__u)); }
75 && std::__detail::__not_overloaded_spaceship<_Tp, _Up>;
86 template<
typename _Tp,
typename _Up>
87 requires equality_comparable_with<_Tp, _Up>
89 operator()(_Tp&& __t, _Up&& __u)
const 90 noexcept(noexcept(std::declval<_Tp>() == std::declval<_Up>()))
91 {
return std::forward<_Tp>(__t) == std::forward<_Up>(__u); }
93 using is_transparent = __is_transparent;
99 template<
typename _Tp,
typename _Up>
100 requires equality_comparable_with<_Tp, _Up>
102 operator()(_Tp&& __t, _Up&& __u)
const 103 noexcept(noexcept(std::declval<_Up>() == std::declval<_Tp>()))
104 {
return !
equal_to{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
106 using is_transparent = __is_transparent;
112 template<
typename _Tp,
typename _Up>
113 requires totally_ordered_with<_Tp, _Up>
115 operator()(_Tp&& __t, _Up&& __u)
const 116 noexcept(noexcept(std::declval<_Tp>() < std::declval<_Up>()))
118 if constexpr (__detail::__less_builtin_ptr_cmp<_Tp, _Up>)
120 if (std::__is_constant_evaluated())
123 auto __x =
reinterpret_cast<__UINTPTR_TYPE__
>(
124 static_cast<const volatile void*
>(std::forward<_Tp>(__t)));
125 auto __y =
reinterpret_cast<__UINTPTR_TYPE__
>(
126 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
130 return std::forward<_Tp>(__t) < std::forward<_Up>(__u);
133 using is_transparent = __is_transparent;
139 template<
typename _Tp,
typename _Up>
140 requires totally_ordered_with<_Tp, _Up>
142 operator()(_Tp&& __t, _Up&& __u)
const 143 noexcept(noexcept(std::declval<_Up>() < std::declval<_Tp>()))
144 {
return less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); }
146 using is_transparent = __is_transparent;
152 template<
typename _Tp,
typename _Up>
153 requires totally_ordered_with<_Tp, _Up>
155 operator()(_Tp&& __t, _Up&& __u)
const 156 noexcept(noexcept(std::declval<_Tp>() < std::declval<_Up>()))
157 {
return !
less{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
159 using is_transparent = __is_transparent;
165 template<
typename _Tp,
typename _Up>
166 requires totally_ordered_with<_Tp, _Up>
168 operator()(_Tp&& __t, _Up&& __u)
const 169 noexcept(noexcept(std::declval<_Up>() < std::declval<_Tp>()))
170 {
return !
less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); }
172 using is_transparent = __is_transparent;
176 #endif // __glibcxx_ranges 177 _GLIBCXX_END_NAMESPACE_VERSION
180 #endif // _RANGES_CMP_H
ranges::equal_to function object type.
ranges::less_equal function object type.
ranges::less function object type.
[func.identity] The identity function.
ISO C++ entities toplevel namespace is std.
ranges::greater_equal function object type.
ranges::not_equal_to function object type.
ranges::greater function object type.