&& three_way_comparable_with<_It, _It2>
{ return _M_current <=> __y; }
- template<__detail::__not_a_const_iterator _It2>
+ template<__detail::__not_a_const_iterator _It2, same_as<_It> _It3>
friend constexpr bool
- operator<(const _It2& __x, const basic_const_iterator& __y)
+ operator<(const _It2& __x, const basic_const_iterator<_It3>& __y)
noexcept(noexcept(__x < __y._M_current))
requires random_access_iterator<_It> && totally_ordered_with<_It, _It2>
{ return __x < __y._M_current; }
- template<__detail::__not_a_const_iterator _It2>
+ template<__detail::__not_a_const_iterator _It2, same_as<_It> _It3>
friend constexpr bool
- operator>(const _It2& __x, const basic_const_iterator& __y)
+ operator>(const _It2& __x, const basic_const_iterator<_It3>& __y)
noexcept(noexcept(__x > __y._M_current))
requires random_access_iterator<_It> && totally_ordered_with<_It, _It2>
{ return __x > __y._M_current; }
- template<__detail::__not_a_const_iterator _It2>
+ template<__detail::__not_a_const_iterator _It2, same_as<_It> _It3>
friend constexpr bool
- operator<=(const _It2& __x, const basic_const_iterator& __y)
+ operator<=(const _It2& __x, const basic_const_iterator<_It3>& __y)
noexcept(noexcept(__x <= __y._M_current))
requires random_access_iterator<_It> && totally_ordered_with<_It, _It2>
{ return __x <= __y._M_current; }
- template<__detail::__not_a_const_iterator _It2>
+ template<__detail::__not_a_const_iterator _It2, same_as<_It> _It3>
friend constexpr bool
- operator>=(const _It2& __x, const basic_const_iterator& __y)
+ operator>=(const _It2& __x, const basic_const_iterator<_It3>& __y)
noexcept(noexcept(__x >= __y._M_current))
requires random_access_iterator<_It> && totally_ordered_with<_It, _It2>
{ return __x >= __y._M_current; }
--- /dev/null
+// { dg-do compile { target c++23 } }
+
+// PR libstdc++/112490 - infinite meta error in
+// reverse_iterator<basic_const_iterator<vector<int>::iterator>>
+
+#include <iterator>
+#include <vector>
+
+using I = std::vector<int>::iterator;
+using CI = std::basic_const_iterator<I>;
+using RCI = std::reverse_iterator<CI>;
+static_assert(std::totally_ordered<RCI>);