31 #define _RANGE_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>
51 operator()(_Tp&& __t)
const noexcept
52 {
return std::forward<_Tp>(__t); }
54 using is_transparent = __is_transparent;
57 #ifdef __cpp_lib_concepts
59 #define __cpp_lib_ranges 201911L
68 template<
typename _Tp,
typename _Up>
69 concept __less_builtin_ptr_cmp
70 = requires (_Tp&& __t, _Up&& __u) { { __t < __u } -> same_as<bool>; }
71 && convertible_to<_Tp, const volatile void*>
72 && convertible_to<_Up, const volatile void*>
73 && (! requires(_Tp&& __t, _Up&& __u)
74 { operator<(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
75 && ! requires(_Tp&& __t, _Up&& __u)
76 { std::forward<_Tp>(__t).operator<(std::forward<_Up>(__u)); });
87 template<
typename _Tp,
typename _Up>
88 requires equality_comparable_with<_Tp, _Up>
90 operator()(_Tp&& __t, _Up&& __u)
const
91 noexcept(noexcept(std::declval<_Tp>() == std::declval<_Up>()))
92 {
return std::forward<_Tp>(__t) == std::forward<_Up>(__u); }
94 using is_transparent = __is_transparent;
100 template<
typename _Tp,
typename _Up>
101 requires equality_comparable_with<_Tp, _Up>
103 operator()(_Tp&& __t, _Up&& __u)
const
104 noexcept(noexcept(std::declval<_Up>() == std::declval<_Tp>()))
105 {
return !equal_to{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
107 using is_transparent = __is_transparent;
113 template<
typename _Tp,
typename _Up>
114 requires totally_ordered_with<_Tp, _Up>
116 operator()(_Tp&& __t, _Up&& __u)
const
117 noexcept(noexcept(std::declval<_Tp>() < std::declval<_Up>()))
119 if constexpr (__detail::__less_builtin_ptr_cmp<_Tp, _Up>)
121 #ifdef __cpp_lib_is_constant_evaluated
122 if (std::is_constant_evaluated())
125 auto __x =
reinterpret_cast<__UINTPTR_TYPE__
>(
126 static_cast<const volatile void*
>(std::forward<_Tp>(__t)));
127 auto __y =
reinterpret_cast<__UINTPTR_TYPE__
>(
128 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
132 return std::forward<_Tp>(__t) < std::forward<_Up>(__u);
135 using is_transparent = __is_transparent;
141 template<
typename _Tp,
typename _Up>
142 requires totally_ordered_with<_Tp, _Up>
144 operator()(_Tp&& __t, _Up&& __u)
const
145 noexcept(noexcept(std::declval<_Up>() < std::declval<_Tp>()))
146 {
return less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); }
148 using is_transparent = __is_transparent;
154 template<
typename _Tp,
typename _Up>
155 requires totally_ordered_with<_Tp, _Up>
157 operator()(_Tp&& __t, _Up&& __u)
const
158 noexcept(noexcept(std::declval<_Tp>() < std::declval<_Up>()))
159 {
return !less{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
161 using is_transparent = __is_transparent;
167 template<
typename _Tp,
typename _Up>
168 requires totally_ordered_with<_Tp, _Up>
170 operator()(_Tp&& __t, _Up&& __u)
const
171 noexcept(noexcept(std::declval<_Up>() < std::declval<_Tp>()))
172 {
return !less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); }
174 using is_transparent = __is_transparent;
179 _GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.