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 template<
typename _Tp>
52 operator()(_Tp&& __t)
const noexcept
53 {
return std::forward<_Tp>(__t); }
55 using is_transparent = __is_transparent;
58#ifdef __cpp_lib_concepts
60#define __cpp_lib_ranges 202106L
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)); });
88 template<
typename _Tp,
typename _Up>
89 requires equality_comparable_with<_Tp, _Up>
91 operator()(_Tp&& __t, _Up&& __u)
const
92 noexcept(
noexcept(std::declval<_Tp>() == std::declval<_Up>()))
93 {
return std::forward<_Tp>(__t) == std::forward<_Up>(__u); }
95 using is_transparent = __is_transparent;
101 template<
typename _Tp,
typename _Up>
102 requires equality_comparable_with<_Tp, _Up>
104 operator()(_Tp&& __t, _Up&& __u)
const
105 noexcept(
noexcept(std::declval<_Up>() == std::declval<_Tp>()))
106 {
return !equal_to{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
108 using is_transparent = __is_transparent;
114 template<
typename _Tp,
typename _Up>
115 requires totally_ordered_with<_Tp, _Up>
117 operator()(_Tp&& __t, _Up&& __u)
const
118 noexcept(
noexcept(std::declval<_Tp>() < std::declval<_Up>()))
120 if constexpr (__detail::__less_builtin_ptr_cmp<_Tp, _Up>)
122#ifdef __cpp_lib_is_constant_evaluated
123 if (std::is_constant_evaluated())
126 auto __x =
reinterpret_cast<__UINTPTR_TYPE__
>(
127 static_cast<const volatile void*
>(std::forward<_Tp>(__t)));
128 auto __y =
reinterpret_cast<__UINTPTR_TYPE__
>(
129 static_cast<const volatile void*
>(std::forward<_Up>(__u)));
133 return std::forward<_Tp>(__t) < std::forward<_Up>(__u);
136 using is_transparent = __is_transparent;
142 template<
typename _Tp,
typename _Up>
143 requires totally_ordered_with<_Tp, _Up>
145 operator()(_Tp&& __t, _Up&& __u)
const
146 noexcept(
noexcept(std::declval<_Up>() < std::declval<_Tp>()))
147 {
return less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); }
149 using is_transparent = __is_transparent;
155 template<
typename _Tp,
typename _Up>
156 requires totally_ordered_with<_Tp, _Up>
158 operator()(_Tp&& __t, _Up&& __u)
const
159 noexcept(
noexcept(std::declval<_Tp>() < std::declval<_Up>()))
160 {
return !less{}(std::forward<_Tp>(__t), std::forward<_Up>(__u)); }
162 using is_transparent = __is_transparent;
168 template<
typename _Tp,
typename _Up>
169 requires totally_ordered_with<_Tp, _Up>
171 operator()(_Tp&& __t, _Up&& __u)
const
172 noexcept(
noexcept(std::declval<_Up>() < std::declval<_Tp>()))
173 {
return !less{}(std::forward<_Up>(__u), std::forward<_Tp>(__t)); }
175 using is_transparent = __is_transparent;
180_GLIBCXX_END_NAMESPACE_VERSION
ISO C++ entities toplevel namespace is std.