libstdc++: Fix condition for memoizing reverse_view::begin() [PR100621]
commit03cf8d54e5c27cfe6b184cc96757cab30d8fa1df
authorPatrick Palka <ppalka@redhat.com>
Tue, 18 May 2021 04:26:25 +0000 (18 00:26 -0400)
committerPatrick Palka <ppalka@redhat.com>
Tue, 18 May 2021 04:26:25 +0000 (18 00:26 -0400)
tree88dac99b5e5398864699ab9fa636e72afccd7d0a
parent2e2eef80ac0c21f9533e6791ccf5e29458cbb77c
libstdc++: Fix condition for memoizing reverse_view::begin() [PR100621]

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.
libstdc++-v3/include/std/ranges