[gcc r12-521] libstdc++: Implement LWG 3517/3520 for join_view/transform_view

Patrick Palka ppalka@gcc.gnu.org
Wed May 5 16:08:33 GMT 2021


https://gcc.gnu.org/g:2663727d853438ee4d67b200a08f94a318745486

commit r12-521-g2663727d853438ee4d67b200a08f94a318745486
Author: Patrick Palka <ppalka@redhat.com>
Date:   Wed May 5 12:07:32 2021 -0400

    libstdc++: Implement LWG 3517/3520 for join_view/transform_view
    
    libstdc++-v3/ChangeLog:
    
            * include/std/ranges (transform_view::_Iterator::iter_swap):
            Remove as per LWG 3520.
            (join_view::_Iterator::iter_swap): Add indirectly_swappable
            constraint as per LWG 3517.

Diff:
---
 libstdc++-v3/include/std/ranges | 7 +------
 1 file changed, 1 insertion(+), 6 deletions(-)

diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index 4a7ca49b45d..f21e08a36e3 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -1581,12 +1581,6 @@ namespace views::__adaptor
 	      return *__i;
 	  }
 
-	  friend constexpr void
-	  iter_swap(const _Iterator& __x, const _Iterator& __y)
-	    noexcept(noexcept(ranges::iter_swap(__x._M_current, __y._M_current)))
-	    requires indirectly_swappable<_Base_iter>
-	  { return ranges::iter_swap(__x._M_current, __y._M_current); }
-
 	  friend _Iterator<!_Const>;
 	  template<bool> friend struct _Sentinel;
 	};
@@ -2520,6 +2514,7 @@ namespace views::__adaptor
 	  friend constexpr void
 	  iter_swap(const _Iterator& __x, const _Iterator& __y)
 	    noexcept(noexcept(ranges::iter_swap(__x._M_inner, __y._M_inner)))
+	    requires indirectly_swappable<_Inner_iter>
 	  { return ranges::iter_swap(__x._M_inner, __y._M_inner); }
 
 	  friend _Iterator<!_Const>;


More information about the Libstdc++-cvs mailing list