[PATCH] libstdc++: Implement LWG 3517 and 3520 for transform_view/join_view

Patrick Palka ppalka@redhat.com
Wed May 5 01:42:32 GMT 2021


Tested on x86_64-pc-linux-gnu, does this look OK for trunk and perhaps
10/11?

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.
---
 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>;
-- 
2.31.1.442.g7e39198978



More information about the Libstdc++ mailing list