https://gcc.gnu.org/bugzilla/show_bug.cgi?id=105611

--- Comment #2 from 康桓瑋 <hewillk at gmail dot com> ---
(In reply to Patrick Palka from comment #1)
> std::shift_left/right require a Cpp17ForwardIterator, but here I is not
> default constructible which seems like a constraint violation making the
> testcase invalid?
> 
> Using ranges::next on a legacy iterator is kind of sketchy, agreed, but I'm
> not sure it's wrong?

Good point. But I can imagine another contrived case where I might be C++98
random access iterators:

struct I {
  I& operator++();
  /* other type convertible to const I& */ operator++(int);
};

But I is just a C++20 input iterator because operator++(int) does not return I
exactly, which may lead to a performance issue for ranges::next.

Reply via email to