public inbox for libstdc++-cvs@sourceware.org help / color / mirror / Atom feed
From: Patrick Palka <ppalka@gcc.gnu.org> To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r11-9820] libstdc++: Implement LWG 3591-3592 changes to split_view Date: Tue, 12 Apr 2022 14:28:53 +0000 (GMT) [thread overview] Message-ID: <20220412142853.89C5D385803D@sourceware.org> (raw) https://gcc.gnu.org/g:130b959f23396fd71b135b8cef67e10a95487902 commit r11-9820-g130b959f23396fd71b135b8cef67e10a95487902 Author: Patrick Palka <ppalka@redhat.com> Date: Wed Oct 20 21:34:23 2021 -0400 libstdc++: Implement LWG 3591-3592 changes to split_view libstdc++-v3/ChangeLog: * include/std/ranges (split_view::base): Add forward_range constraint as per LWG 3591. (split_view::begin, lazy_split_view::end): Also check simpleness of _Pattern as per LWG 3592. (cherry picked from commit 2d3ac6039074832978ce9bcd41ba93ef4812458f) Diff: --- libstdc++-v3/include/std/ranges | 14 +++++++++----- 1 file changed, 9 insertions(+), 5 deletions(-) diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges index 52ca9080759..f55ee15e1b1 100644 --- a/libstdc++-v3/include/std/ranges +++ b/libstdc++-v3/include/std/ranges @@ -3072,7 +3072,7 @@ namespace views::__adaptor { return _M_i_current(); } constexpr iterator_t<_Base> - base() && + base() && requires forward_range<_Vp> { return std::move(_M_i_current()); } constexpr decltype(auto) @@ -3166,8 +3166,11 @@ namespace views::__adaptor begin() { if constexpr (forward_range<_Vp>) - return _OuterIter<__detail::__simple_view<_Vp>>{ - this, ranges::begin(_M_base)}; + { + constexpr bool __simple + = __detail::__simple_view<_Vp> && __detail::__simple_view<_Pattern>; + return _OuterIter<__simple>{this, ranges::begin(_M_base)}; + } else { _M_current = ranges::begin(_M_base); @@ -3184,8 +3187,9 @@ namespace views::__adaptor constexpr auto end() requires forward_range<_Vp> && common_range<_Vp> { - return _OuterIter<__detail::__simple_view<_Vp>>{ - this, ranges::end(_M_base)}; + constexpr bool __simple + = __detail::__simple_view<_Vp> && __detail::__simple_view<_Pattern>; + return _OuterIter<__simple>{this, ranges::end(_M_base)}; } constexpr auto
reply other threads:[~2022-04-12 14:28 UTC|newest] Thread overview: [no followups] expand[flat|nested] mbox.gz Atom feed
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=20220412142853.89C5D385803D@sourceware.org \ --to=ppalka@gcc.gnu.org \ --cc=gcc-cvs@gcc.gnu.org \ --cc=libstdc++-cvs@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: linkBe 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).