[gcc r10-9906] libstdc++: Implement LWG 3533 changes to foo_view::iterator::base()

Patrick Palka ppalka@gcc.gnu.org
Thu Jun 10 19:08:11 GMT 2021


https://gcc.gnu.org/g:3c01b4dd1b61399e9c06e3543531bee2bd38fac4

commit r10-9906-g3c01b4dd1b61399e9c06e3543531bee2bd38fac4
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 5f67f830174..c69a44f2ed8 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -1478,9 +1478,8 @@ namespace views
 	    _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
@@ -1729,9 +1728,8 @@ namespace views
 	    : _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
@@ -3467,8 +3465,8 @@ namespace views
 	: _M_base(std::move(base))
       { }
 
-      constexpr _Vp
-      base() const& requires copy_constructible<_Vp>
+      constexpr const _Vp&
+      base() const & noexcept
       { return _M_base; }
 
       constexpr _Vp


More information about the Libstdc++-cvs mailing list