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-8544] libstdc++: Implement LWG 3533 changes to foo_view::iterator::base()
Date: Thu, 10 Jun 2021 19:03:24 +0000 (GMT)	[thread overview]
Message-ID: <20210610190324.1B0E9399BC1C@sourceware.org> (raw)

https://gcc.gnu.org/g:e3804ba98f2d8de9b4540d134fa0d9275a1e8057

commit r11-8544-ge3804ba98f2d8de9b4540d134fa0d9275a1e8057
Author: Patrick Palka <ppalka@redhat.com>
Date:   Thu May 6 09:11:44 2021 -0400

    libstdc++: Implement LWG 3533 changes to foo_view::iterator::base()
    
    libstdc++-v3/ChangeLog:
    
            * include/std/ranges (filter_view::_Iterator::base): Make the
            const& overload unconstrained and return a const reference as
            per LWG 3533.  Make unconditionally noexcept.
            (transform_view::_Iterator::base): Likewise.
            (elements_view::_Iterator::base): Likewise.
    
    (cherry picked from commit eb1aa9ad2afbcd8f3e939310d5785ff8563a8c5c)

Diff:
---
 libstdc++-v3/include/std/ranges | 14 ++++++--------
 1 file changed, 6 insertions(+), 8 deletions(-)

diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index 265e109bc7e..1f4093a17b5 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -1263,9 +1263,8 @@ namespace views::__adaptor
 	    _M_parent(__parent)
 	{ }
 
-	constexpr _Vp_iter
-	base() const &
-	  requires copyable<_Vp_iter>
+	constexpr const _Vp_iter&
+	base() const & noexcept
 	{ return _M_current; }
 
 	constexpr _Vp_iter
@@ -1531,9 +1530,8 @@ namespace views::__adaptor
 	    : _M_current(std::move(__i._M_current)), _M_parent(__i._M_parent)
 	  { }
 
-	  constexpr _Base_iter
-	  base() const &
-	    requires copyable<_Base_iter>
+	  constexpr const _Base_iter&
+	  base() const & noexcept
 	  { return _M_current; }
 
 	  constexpr _Base_iter
@@ -3407,8 +3405,8 @@ namespace views::__adaptor
 	: _M_base(std::move(base))
       { }
 
-      constexpr _Vp
-      base() const& requires copy_constructible<_Vp>
+      constexpr const _Vp&
+      base() const & noexcept
       { return _M_base; }
 
       constexpr _Vp


                 reply	other threads:[~2021-06-10 19:03 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=20210610190324.1B0E9399BC1C@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: 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).