public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
* [Bug libstdc++/106798] New: adjacent_view::_Iterator(_Iterator<!_Const>) requires random_access_iterator
@ 2022-09-01  5:57 hewillk at gmail dot com
  2022-09-01 10:07 ` [Bug libstdc++/106798] " hewillk at gmail dot com
                   ` (3 more replies)
  0 siblings, 4 replies; 5+ messages in thread
From: hewillk at gmail dot com @ 2022-09-01  5:57 UTC (permalink / raw)
  To: gcc-bugs

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

            Bug ID: 106798
           Summary: adjacent_view::_Iterator(_Iterator<!_Const>) requires
                    random_access_iterator
           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: ---

ranges#L5216:

    constexpr
    _Iterator(_Iterator<!_Const> __i)
      requires _Const && convertible_to<iterator_t<_Vp>, iterator_t<_Base>>
    {
      for (size_t __j = 0; __j < _Nm; ++__j)
        _M_current[__j] = std::move(__i[__j]);
    }

__i[__j] requires random_access_iterator, which is unnecessary.
ranges::move(__i._M_current, _M_current.begin()) should be enough (which
requires an extra include header).
The testcase would be


    #include <ranges>
    int main() {
      const auto r = std::views::single(0)
                   | std::views::lazy_split(0)
                   | std::views::pairwise;
      decltype(r.end()) e = auto(r).end();
    }

^ permalink raw reply	[flat|nested] 5+ messages in thread

end of thread, other threads:[~2022-09-09 19:06 UTC | newest]

Thread overview: 5+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2022-09-01  5:57 [Bug libstdc++/106798] New: adjacent_view::_Iterator(_Iterator<!_Const>) requires random_access_iterator hewillk at gmail dot com
2022-09-01 10:07 ` [Bug libstdc++/106798] " hewillk at gmail dot com
2022-09-01 14:04 ` ppalka at gcc dot gnu.org
2022-09-09 19:05 ` cvs-commit at gcc dot gnu.org
2022-09-09 19:06 ` ppalka at gcc dot gnu.org

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).