[gcc(refs/users/guojiufu/heads/guojiufu-branch)] libstdc++: Remove converting constructors from views (LWG 3280)
Jiu Fu Guo
guojiufu@gcc.gnu.org
Wed Mar 11 02:07:26 GMT 2020
https://gcc.gnu.org/g:4cc3b275d310dbf5982544cb88c11630349f414c
commit 4cc3b275d310dbf5982544cb88c11630349f414c
Author: Jonathan Wakely <jwakely@redhat.com>
Date: Wed Feb 19 12:26:19 2020 +0000
libstdc++: Remove converting constructors from views (LWG 3280)
* include/std/ranges (filter_view, transform_view, take_view)
(join_view, split_view, reverse_view): Remove commented-out converting
constructors (LWG 3280).
Diff:
---
libstdc++-v3/ChangeLog | 4 +++
libstdc++-v3/include/std/ranges | 68 +++--------------------------------------
2 files changed, 8 insertions(+), 64 deletions(-)
diff --git a/libstdc++-v3/ChangeLog b/libstdc++-v3/ChangeLog
index 5408a89c7fb..9ccba4345d5 100644
--- a/libstdc++-v3/ChangeLog
+++ b/libstdc++-v3/ChangeLog
@@ -1,5 +1,9 @@
2020-02-19 Jonathan Wakely <jwakely@redhat.com>
+ * include/std/ranges (filter_view, transform_view, take_view)
+ (join_view, split_view, reverse_view): Remove commented-out converting
+ constructors (LWG 3280).
+
* include/std/memory (uninitialized_construct_using_allocator): Use
std::construct_at (LWG 3321).
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index 4bfda88c319..cf4c19ffaab 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -1470,17 +1470,6 @@ namespace views
: _M_base(std::move(__base)), _M_pred(std::move(__pred))
{ }
- /* XXX: P3280 removes this constructor
- template<input_range _Range>
- requires viewable_range<_Range>
- && constructible_from<_Vp, all_view<_Range>>
- constexpr
- filter_view(_Range&& __r, _Pred __pred)
- : _M_base(views::all(std::forward<_Range>(__r))),
- _M_pred(std::move(__pred))
- { }
- */
-
constexpr _Vp
base() const& requires copy_constructible<_Vp>
{ return _M_base; }
@@ -1799,17 +1788,6 @@ namespace views
: _M_base(std::move(__base)), _M_fun(std::move(__fun))
{ }
- /* XXX: P3280 removes this constructor
- template<input_range _Range>
- requires viewable_range<_Range>
- && constructible_from<_Vp, all_view<_Range>>
- constexpr
- transform_view(_Range&& __r, _Fp __fun)
- : _M_base(views::all(std::forward<_Range>(__r)))
- {
- }
- */
-
constexpr _Vp
base() const& requires copy_constructible<_Vp>
{ return _M_base ; }
@@ -1915,15 +1893,6 @@ namespace views
: _M_base(std::move(base)), _M_count(std::move(__count))
{ }
- /* XXX: P3280 removes this constructor
- template<viewable_range _Range>
- requires constructible_from<_Vp, all_view<_Range>>
- constexpr
- take_view(_Range&& __r, range_difference_t<_Vp> __count)
- : _M_base(views::all(std::forward<_Range>(__r))), _M_count(__count)
- { }
- */
-
constexpr _Vp
base() const& requires copy_constructible<_Vp>
{ return _M_base; }
@@ -2491,16 +2460,6 @@ namespace views
: _M_base(std::move(__base))
{ }
- /* XXX: P3280 removes this constructor
- template<input_range _Range>
- requires viewable_range<_Range>
- && constructible_from<_Vp, all_view<_Range>>
- constexpr explicit
- join_view(_Range&& __r)
- : _M_base(views::all(std::forward<_Range>(__r)))
- { }
- */
-
constexpr _Vp
base() const& requires copy_constructible<_Vp>
{ return _M_base; }
@@ -2878,17 +2837,6 @@ namespace views
: _M_base(std::move(__base)), _M_pattern(std::move(__pattern))
{ }
- /* XXX: P3280 removes this constructor
- template<input_range _Range, forward_range _Pred>
- requires constructible_from<_Vp, all_view<_Range>>
- && constructible_from<_Pattern, all_view<_Pred>>
- constexpr
- split_view(_Range&& __r, _Pred&& __p)
- : _M_base(views::all(std::forward<_Range>(__r))),
- _M_pattern(views::all(std::forward<_Pred>(__p)))
- { }
- */
-
template<input_range _Range>
requires constructible_from<_Vp, all_view<_Range>>
&& constructible_from<_Pattern, single_view<range_value_t<_Range>>>
@@ -2994,14 +2942,15 @@ namespace views
: _M_base(std::move(__r))
{ }
- /* XXX: P3280 doesn't remove this constructor, but I think it should?
+ /* XXX: LWG 3280 didn't remove this constructor, but I think it should?
template<viewable_range _Range>
- requires (!common_range<_Range>) && constructible_from<_Vp, all_view<_Range>>
+ requires (!common_range<_Range>)
+ && constructible_from<_Vp, all_view<_Range>>
constexpr explicit
common_view(_Range&& __r)
: _M_base(views::all(std::forward<_Range>(__r)))
{ }
- */
+ */
constexpr _Vp
base() const& requires copy_constructible<_Vp>
@@ -3092,15 +3041,6 @@ namespace views
: _M_base(std::move(__r))
{ }
- /* XXX: P3280 removes this constructor
- template<viewable_range _Range>
- requires bidirectional_range<_Range> && constructible_from<_Vp, all_view<_Range>>
- constexpr explicit
- reverse_view(_Range&& __r)
- : _M_base(views::all(std::forward<_Range>(__r)))
- { }
- */
-
constexpr _Vp
base() const& requires copy_constructible<_Vp>
{ return _M_base; }
More information about the Libstdc++-cvs
mailing list