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

            Bug ID: 107313
           Summary: typo in stride_view::_Iterator::operator-
           Product: gcc
           Version: 13.0
            Status: UNCONFIRMED
          Severity: normal
          Priority: P3
         Component: libstdc++
          Assignee: unassigned at gcc dot gnu.org
          Reporter: hewillk at gmail dot com
  Target Milestone: ---

std/ranges#L7877:

    friend constexpr difference_type
    operator-(default_sentinel_t __y, const _Iterator& __x)
      requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Base>>
    { return __detail::__div_ceil(__x._M_end, __x._M_current, __x._M_stride); }

The ',' should be '-'.

testcase:

    #include <iostream>
    #include <ranges>
    int main() {
      auto i = std::views::istream<int>(std::cin);
      auto r = std::views::counted(i.begin(), 4)
             | std::views::stride(2);
      auto d = r.begin() - r.end();
    }

Reply via email to