On Fri, 18 Sept 2026 at 15:56, Tomasz Kaminski <[email protected]> wrote: > > > > On Fri, Sep 18, 2026 at 4:50 PM Tomasz Kamiński <[email protected]> wrote: >> >> The checks against _M_current being negive were disabled for cases where >> _Bound denotes unreachable_sentinel_t. However, _M_current has ptrdiff_t >> type in that case, and this check are as meaningfull are for integer bound. >> >> libstdc++-v3/ChangeLog: >> >> * include/std/ranges (repeat_view::_Iterator::_Iterator) >> (repeat_view::_Iterator::operator--) >> (repeat_view::_Iterator::operator+=) >> (repeat_view::_Iterator::operator-=): Unconditionally assert >> on _M_current having non-negative value. >> --- >> Noticed that when working on extracting _Repeat_iterator (that I >> templated with _IndexType). Worth to be separate. > > I wonder if it makes sense to modify the standard, to say that > views::repeat(x, n) is equivalent to repeate_view<T, ptrdiff_t> if > n is integral an numeric_limits<decltype(x)>::max <= ptrdiff_max_t. > This reduces the number of template instantiations, but is technically > breaking. Maybe it is too late.
It's not too late for us to change the C++23 ABI, so we could ask libc++ and STL maintainers.
