A range being a random access range isn't a sufficient condition for
ranges::next(iter, sent) to have constant time complexity -- it must
also have a sized sentinel. This adjusts the memoization condition for
reverse_view accordingly.
libstdc++-v3/ChangeLog:
PR libstdc++/100621
* include/std/ranges (reverse_view::_S_needs_cached_begin):
Set to true if the underlying non-common random-access range
doesn't have a sized sentinel.
{
private:
static constexpr bool _S_needs_cached_begin
- = !common_range<_Vp> && !random_access_range<_Vp>;
+ = !common_range<_Vp> && !(random_access_range<_Vp>
+ && sized_sentinel_for<sentinel_t<_Vp>,
+ iterator_t<_Vp>>);
[[no_unique_address]]
__detail::__maybe_present_t<_S_needs_cached_begin,