31#define _RANGES_CMP_H 1
33#if __cplusplus > 201703L
37namespace std _GLIBCXX_VISIBILITY(default)
39_GLIBCXX_BEGIN_NAMESPACE_VERSION
41 struct __is_transparent;
49#pragma GCC diagnostic push
50#pragma GCC diagnostic ignored "-Wc++23-extensions"
51 template<
typename _Tp>
53 static constexpr _Tp&&
54 operator()(_Tp&& __t)
noexcept
55 {
return std::forward<_Tp>(__t); }
56#pragma GCC diagnostic pop
58 using is_transparent = __is_transparent;
61#ifdef __glibcxx_ranges
69 template<
typename _Tp,
typename _Up>
70 concept __less_builtin_ptr_cmp
71 =
requires (_Tp&& __t, _Up&& __u) { { __t < __u } -> same_as<bool>; }
72 && convertible_to<_Tp, const volatile void*>
73 && convertible_to<_Up, const volatile void*>
74 && !
requires(_Tp&& __t, _Up&& __u)
75 { operator<(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
76 && !
requires(_Tp&& __t, _Up&& __u)
77 { std::forward<_Tp>(__t).operator<(std::forward<_Up>(__u)); }
78 && std::__detail::__not_overloaded_spaceship<_Tp, _Up>;
86#pragma GCC diagnostic push
87#pragma GCC diagnostic ignored "-Wc++23-extensions"
91 template<
typename _Tp,
typename _Up>
92 requires equality_comparable_with<_Tp, _Up>
94 operator()(_Tp&& __t, _Up&& __u)
95 noexcept(
noexcept(std::declval<_Tp>() == std::declval<_Up>()))
96 {
return std::forward<_Tp>(__t) == std::forward<_Up>(__u); }
98 using is_transparent = __is_transparent;
104 template<
typename _Tp,
typename _Up>
105 requires equality_comparable_with<_Tp, _Up>
106 static constexpr bool
107 operator()(_Tp&& __t, _Up&& __u)
108 noexcept(
noexcept(std::declval<_Tp>() == std::declval<_Up>()))
109 {
return !
equal_to{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
111 using is_transparent = __is_transparent;
117 template<
typename _Tp,
typename _Up>
118 requires totally_ordered_with<_Tp, _Up>
119 static constexpr bool
120 operator()(_Tp&& __t, _Up&& __u)
121 noexcept(
noexcept(std::declval<_Tp>() < std::declval<_Up>()))
123 if constexpr (__detail::__less_builtin_ptr_cmp<_Tp, _Up>)
125 if (std::__is_constant_evaluated())
128 auto __x =
reinterpret_cast<__UINTPTR_TYPE__
>(
129 static_cast<const volatile void*
>(std::forward<_Tp>(__t)));
130 auto __y =
reinterpret_cast<__UINTPTR_TYPE__
>(
131 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
135 return std::forward<_Tp>(__t) < std::forward<_Up>(__u);
138 using is_transparent = __is_transparent;
144 template<
typename _Tp,
typename _Up>
145 requires totally_ordered_with<_Tp, _Up>
146 static constexpr bool
147 operator()(_Tp&& __t, _Up&& __u)
148 noexcept(
noexcept(std::declval<_Up>() < std::declval<_Tp>()))
149 {
return less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); }
151 using is_transparent = __is_transparent;
157 template<
typename _Tp,
typename _Up>
158 requires totally_ordered_with<_Tp, _Up>
159 static constexpr bool
160 operator()(_Tp&& __t, _Up&& __u)
161 noexcept(
noexcept(std::declval<_Tp>() < std::declval<_Up>()))
162 {
return !
less{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
164 using is_transparent = __is_transparent;
170 template<
typename _Tp,
typename _Up>
171 requires totally_ordered_with<_Tp, _Up>
172 static constexpr bool
173 operator()(_Tp&& __t, _Up&& __u)
174 noexcept(
noexcept(std::declval<_Up>() < std::declval<_Tp>()))
175 {
return !
less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); }
177 using is_transparent = __is_transparent;
179#pragma GCC diagnostic pop
183_GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.
[func.identity] The identity function.
ranges::equal_to function object type.
ranges::not_equal_to function object type.
ranges::less function object type.
ranges::greater function object type.
ranges::greater_equal function object type.
ranges::less_equal function object type.