public inbox for gcc-bugs@sourceware.org
help / color / mirror / Atom feed
From: "ppalka at gcc dot gnu.org" <gcc-bugzilla@gcc.gnu.org>
To: gcc-bugs@gcc.gnu.org
Subject: [Bug libstdc++/100631] ranges::elements_view:: _Sentinel is missing __distance_from() that can access _M_current of _Iterator
Date: Tue, 18 May 2021 13:50:33 +0000 [thread overview]
Message-ID: <bug-100631-4-VJ59NuhOH8@http.gcc.gnu.org/bugzilla/> (raw)
In-Reply-To: <bug-100631-4@http.gcc.gnu.org/bugzilla/>
https://gcc.gnu.org/bugzilla/show_bug.cgi?id=100631
--- Comment #8 from Patrick Palka <ppalka at gcc dot gnu.org> ---
(In reply to 康桓瑋 from comment #7)
> (In reply to CVS Commits from comment #6)
> > The master branch has been updated by Patrick Palka <ppalka@gcc.gnu.org>:
> >
> > https://gcc.gnu.org/g:2e2eef80ac0c21f9533e6791ccf5e29458cbb77c
> >
> > commit r12-854-g2e2eef80ac0c21f9533e6791ccf5e29458cbb77c
> > Author: Patrick Palka <ppalka@redhat.com>
> > Date: Tue May 18 00:26:07 2021 -0400
> >
> > libstdc++: Fix miscellaneous issues with elements_view::_Sentinel
> > [PR100631]
> >
> > libstdc++-v3/ChangeLog:
> >
> > PR libstdc++/100631
> > * include/std/ranges (elements_view::_Iterator): Also befriend
> > _Sentinel<!_Const>.
> > (elements_view::_Sentinel::_M_equal): Templatize.
> > (elements_view::_Sentinel::_M_distance_from): Split out from ...
> > (elements_view::_Sentinel::operator-): ... here. Depend on
> > _Base2 instead of _Base in the return type.
> > * testsuite/std/ranges/adaptors/elements.cc (test06, test07):
> > New tests.
>
>
>
> Hey, Patrick, you missed the second one:
>
>
> template<bool _Const2,
> typename _Base2 = __detail::__maybe_const_t<_Const2, _Vp>>
> requires sized_sentinel_for<sentinel_t<_Base>, iterator_t<_Base2>>
> friend constexpr range_difference_t<_Base2>
> operator-(const _Iterator<_Const2>& __x, const _Sentinel& __y)
> { return __x._M_current - __y._M_end; }
>
>
> this should be return -__y._M_distance_from(__x).
Indeed, thanks for catching that. Fix incoming shortly..
next prev parent reply other threads:[~2021-05-18 13:50 UTC|newest]
Thread overview: 15+ messages / expand[flat|nested] mbox.gz Atom feed top
2021-05-17 3:22 [Bug libstdc++/100631] New: " hewillk at gmail dot com
2021-05-17 3:45 ` [Bug libstdc++/100631] " hewillk at gmail dot com
2021-05-17 4:50 ` hewillk at gmail dot com
2021-05-17 10:29 ` ppalka at gcc dot gnu.org
2021-05-17 12:32 ` rs2740 at gmail dot com
2021-05-17 13:34 ` hewillk at gmail dot com
2021-05-18 4:35 ` cvs-commit at gcc dot gnu.org
2021-05-18 5:32 ` hewillk at gmail dot com
2021-05-18 13:50 ` ppalka at gcc dot gnu.org [this message]
2021-05-18 14:22 ` cvs-commit at gcc dot gnu.org
2021-06-10 18:54 ` cvs-commit at gcc dot gnu.org
2021-06-10 18:54 ` cvs-commit at gcc dot gnu.org
2021-06-10 18:57 ` cvs-commit at gcc dot gnu.org
2021-06-10 18:58 ` cvs-commit at gcc dot gnu.org
2021-06-10 18:58 ` ppalka at gcc dot gnu.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=bug-100631-4-VJ59NuhOH8@http.gcc.gnu.org/bugzilla/ \
--to=gcc-bugzilla@gcc.gnu.org \
--cc=gcc-bugs@gcc.gnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).