https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100795
Patrick Palka <ppalka at gcc dot gnu.org> changed:
What |Removed |Added
----------------------------------------------------------------------------
CC| |ppalka at gcc dot gnu.org
--- Comment #6 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to 康桓瑋 from comment #2)
> ranges::inplace_merge has the same issue:
>
>
> #include <algorithm>
> #include <array>
> #include <ranges>
>
> int main() {
> std::array a{42, 42, 42};
> auto r = std::views::iota(0, 3) |
> std::views::transform([&a](int i) -> int& { return a[i]; });
> std::ranges::inplace_merge(r, r.begin());
> }
>
> https://godbolt.org/z/q6jbxGMjd
Hmm, this one seems more like a problem in the specification of
transform_view::iterator_category. Shouldn't r's iterator_category be
random_access_iterator here? AFAICT it satisfies all the requirements of
__LegacyRandomAccessIterator.