* [PATCH] libstdc++: Implement LWG 3535 changes to ranges::join_view
@ 2021-10-20 16:59 Patrick Palka
2021-10-20 18:57 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Patrick Palka @ 2021-10-20 16:59 UTC (permalink / raw)
To: gcc-patches; +Cc: libstdc++, Patrick Palka
Tested on x86_64-pc-linux-gnu, does this look OK for trunk, and branches
after a while?
libstdc++-v3/ChangeLog:
* include/std/ranges (join_view::__iter_cat::_S_iter_cat): Adjust
criteria for returning bidirectional_iterator_tag as per LWG3535.
(join_view::_Iterator::_S_iter_concept): Likewise.
---
libstdc++-v3/include/std/ranges | 6 ++++--
1 file changed, 4 insertions(+), 2 deletions(-)
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index 273699aa790..c1519c7dbd5 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -2523,7 +2523,8 @@ namespace views::__adaptor
using _OuterCat = typename iterator_traits<_Outer_iter>::iterator_category;
using _InnerCat = typename iterator_traits<_Inner_iter>::iterator_category;
if constexpr (derived_from<_OuterCat, bidirectional_iterator_tag>
- && derived_from<_InnerCat, bidirectional_iterator_tag>)
+ && derived_from<_InnerCat, bidirectional_iterator_tag>
+ && common_range<range_reference_t<_Base<_Const>>>)
return bidirectional_iterator_tag{};
else if constexpr (derived_from<_OuterCat, forward_iterator_tag>
&& derived_from<_InnerCat, forward_iterator_tag>)
@@ -2575,7 +2576,8 @@ namespace views::__adaptor
{
if constexpr (_S_ref_is_glvalue
&& bidirectional_range<_Base>
- && bidirectional_range<range_reference_t<_Base>>)
+ && bidirectional_range<range_reference_t<_Base>>
+ && common_range<range_reference_t<_Base>>)
return bidirectional_iterator_tag{};
else if constexpr (_S_ref_is_glvalue
&& forward_range<_Base>
--
2.33.1.711.g9d530dc002
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libstdc++: Implement LWG 3535 changes to ranges::join_view
2021-10-20 16:59 [PATCH] libstdc++: Implement LWG 3535 changes to ranges::join_view Patrick Palka
@ 2021-10-20 18:57 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2021-10-20 18:57 UTC (permalink / raw)
To: Patrick Palka; +Cc: gcc Patches, libstdc++
On Wed, 20 Oct 2021 at 18:03, Patrick Palka via Libstdc++
<libstdc++@gcc.gnu.org> wrote:
>
> Tested on x86_64-pc-linux-gnu, does this look OK for trunk, and branches
> after a while?
Yes for all.
>
> libstdc++-v3/ChangeLog:
>
> * include/std/ranges (join_view::__iter_cat::_S_iter_cat): Adjust
> criteria for returning bidirectional_iterator_tag as per LWG3535.
> (join_view::_Iterator::_S_iter_concept): Likewise.
> ---
> libstdc++-v3/include/std/ranges | 6 ++++--
> 1 file changed, 4 insertions(+), 2 deletions(-)
>
> diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
> index 273699aa790..c1519c7dbd5 100644
> --- a/libstdc++-v3/include/std/ranges
> +++ b/libstdc++-v3/include/std/ranges
> @@ -2523,7 +2523,8 @@ namespace views::__adaptor
> using _OuterCat = typename iterator_traits<_Outer_iter>::iterator_category;
> using _InnerCat = typename iterator_traits<_Inner_iter>::iterator_category;
> if constexpr (derived_from<_OuterCat, bidirectional_iterator_tag>
> - && derived_from<_InnerCat, bidirectional_iterator_tag>)
> + && derived_from<_InnerCat, bidirectional_iterator_tag>
> + && common_range<range_reference_t<_Base<_Const>>>)
> return bidirectional_iterator_tag{};
> else if constexpr (derived_from<_OuterCat, forward_iterator_tag>
> && derived_from<_InnerCat, forward_iterator_tag>)
> @@ -2575,7 +2576,8 @@ namespace views::__adaptor
> {
> if constexpr (_S_ref_is_glvalue
> && bidirectional_range<_Base>
> - && bidirectional_range<range_reference_t<_Base>>)
> + && bidirectional_range<range_reference_t<_Base>>
> + && common_range<range_reference_t<_Base>>)
> return bidirectional_iterator_tag{};
> else if constexpr (_S_ref_is_glvalue
> && forward_range<_Base>
> --
> 2.33.1.711.g9d530dc002
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-10-20 18:57 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-10-20 16:59 [PATCH] libstdc++: Implement LWG 3535 changes to ranges::join_view Patrick Palka
2021-10-20 18:57 ` 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).