* [PATCH] libstdc++: Implement LWG 3590-3592 changes to split_view/lazy_split_view
@ 2021-10-20 18:17 Patrick Palka
2021-10-20 18:50 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Patrick Palka @ 2021-10-20 18:17 UTC (permalink / raw)
To: gcc-patches; +Cc: libstdc++, Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk, and 11 after
a while?
libstdc++-v3/ChangeLog:
* include/std/ranges (lazy_split_view::base): Add forward_range
constraint as per LWG 3591.
(lazy_split_view::begin, lazy_split_view::end): Also check
simpleness of _Pattern as per LWG 3592.
(split_view::base): Relax copyable constraint as per LWG 3590.
---
libstdc++-v3/include/std/ranges | 16 ++++++++++------
1 file changed, 10 insertions(+), 6 deletions(-)
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index c1519c7dbd5..30ba0606869 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -3137,7 +3137,7 @@ namespace views::__adaptor
{ return _M_i_current(); }
constexpr iterator_t<_Base>
- base() &&
+ base() && requires forward_range<_Vp>
{ return std::move(_M_i_current()); }
constexpr decltype(auto)
@@ -3229,8 +3229,11 @@ namespace views::__adaptor
begin()
{
if constexpr (forward_range<_Vp>)
- return _OuterIter<__detail::__simple_view<_Vp>>{
- this, ranges::begin(_M_base)};
+ {
+ constexpr bool __simple
+ = __detail::__simple_view<_Vp> && __detail::__simple_view<_Pattern>;
+ return _OuterIter<__simple>{this, ranges::begin(_M_base)};
+ }
else
{
_M_current = ranges::begin(_M_base);
@@ -3247,8 +3250,9 @@ namespace views::__adaptor
constexpr auto
end() requires forward_range<_Vp> && common_range<_Vp>
{
- return _OuterIter<__detail::__simple_view<_Vp>>{
- this, ranges::end(_M_base)};
+ constexpr bool __simple
+ = __detail::__simple_view<_Vp> && __detail::__simple_view<_Pattern>;
+ return _OuterIter<__simple>{this, ranges::end(_M_base)};
}
constexpr auto
@@ -3339,7 +3343,7 @@ namespace views::__adaptor
{ }
constexpr _Vp
- base() const& requires copyable<_Vp>
+ base() const& requires copy_constructible<_Vp>
{ return _M_base; }
constexpr _Vp
--
2.33.1.711.g9d530dc002
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libstdc++: Implement LWG 3590-3592 changes to split_view/lazy_split_view
2021-10-20 18:17 [PATCH] libstdc++: Implement LWG 3590-3592 changes to split_view/lazy_split_view Patrick Palka
@ 2021-10-20 18:50 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2021-10-20 18:50 UTC (permalink / raw)
To: Patrick Palka; +Cc: gcc Patches, libstdc++
On Wed, 20 Oct 2021 at 19:17, Patrick Palka wrote:
>
> Tested on x86_64-pc-linux-gnu, does this look OK for trunk, and 11 after
> a while?
Yes for both, thanks.
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-20 18:50 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 18:17 [PATCH] libstdc++: Implement LWG 3590-3592 changes to split_view/lazy_split_view Patrick Palka
2021-10-20 18:50 ` Jonathan Wakely
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).