* [PATCH] libstdc++: Don't constrain some enable_borrowed_range specializations
@ 2021-05-05 1:42 Patrick Palka
2021-05-05 9:40 ` Jonathan Wakely
0 siblings, 1 reply; 2+ messages in thread
From: Patrick Palka @ 2021-05-05 1:42 UTC (permalink / raw)
To: gcc-patches; +Cc: libstdc++, Patrick Palka
These constraints are already present on the template we're partially
specilalizing for.
[ This was recently fixed editorially in
https://github.com/cplusplus/draft/pull/4519 ]
Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
libstdc++-v3/ChangeLog:
* include/bits/ranges_util.h (enable_borrowed_range<subrange>):
Remove constraints on this partial specialization.
* include/std/ranges (enable_borrowed_range<iota_view>):
Likewise.
---
libstdc++-v3/include/bits/ranges_util.h | 3 +--
libstdc++-v3/include/std/ranges | 2 +-
2 files changed, 2 insertions(+), 3 deletions(-)
diff --git a/libstdc++-v3/include/bits/ranges_util.h b/libstdc++-v3/include/bits/ranges_util.h
index 589886eb157..b73fc121e0f 100644
--- a/libstdc++-v3/include/bits/ranges_util.h
+++ b/libstdc++-v3/include/bits/ranges_util.h
@@ -381,8 +381,7 @@ namespace ranges
return __r.end();
}
- template<input_or_output_iterator _It, sentinel_for<_It> _Sent,
- subrange_kind _Kind>
+ template<typename _It, typename _Sent, subrange_kind _Kind>
inline constexpr bool
enable_borrowed_range<subrange<_It, _Sent, _Kind>> = true;
diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
index f21e08a36e3..2305bd200a5 100644
--- a/libstdc++-v3/include/std/ranges
+++ b/libstdc++-v3/include/std/ranges
@@ -586,7 +586,7 @@ namespace ranges
== __detail::__is_signed_integer_like<_Bound>))
iota_view(_Winc, _Bound) -> iota_view<_Winc, _Bound>;
- template<weakly_incrementable _Winc, semiregular _Bound>
+ template<typename _Winc, typename _Bound>
inline constexpr bool
enable_borrowed_range<iota_view<_Winc, _Bound>> = true;
--
2.31.1.442.g7e39198978
^ permalink raw reply [flat|nested] 2+ messages in thread
* Re: [PATCH] libstdc++: Don't constrain some enable_borrowed_range specializations
2021-05-05 1:42 [PATCH] libstdc++: Don't constrain some enable_borrowed_range specializations Patrick Palka
@ 2021-05-05 9:40 ` Jonathan Wakely
0 siblings, 0 replies; 2+ messages in thread
From: Jonathan Wakely @ 2021-05-05 9:40 UTC (permalink / raw)
To: Patrick Palka; +Cc: gcc-patches, libstdc++
On 04/05/21 21:42 -0400, Patrick Palka via Libstdc++ wrote:
>These constraints are already present on the template we're partially
>specilalizing for.
>
>[ This was recently fixed editorially in
>https://github.com/cplusplus/draft/pull/4519 ]
>
>Tested on x86_64-pc-linux-gnu, does this look OK for trunk?
Yes, thanks.
>libstdc++-v3/ChangeLog:
>
> * include/bits/ranges_util.h (enable_borrowed_range<subrange>):
> Remove constraints on this partial specialization.
> * include/std/ranges (enable_borrowed_range<iota_view>):
> Likewise.
>---
> libstdc++-v3/include/bits/ranges_util.h | 3 +--
> libstdc++-v3/include/std/ranges | 2 +-
> 2 files changed, 2 insertions(+), 3 deletions(-)
>
>diff --git a/libstdc++-v3/include/bits/ranges_util.h b/libstdc++-v3/include/bits/ranges_util.h
>index 589886eb157..b73fc121e0f 100644
>--- a/libstdc++-v3/include/bits/ranges_util.h
>+++ b/libstdc++-v3/include/bits/ranges_util.h
>@@ -381,8 +381,7 @@ namespace ranges
> return __r.end();
> }
>
>- template<input_or_output_iterator _It, sentinel_for<_It> _Sent,
>- subrange_kind _Kind>
>+ template<typename _It, typename _Sent, subrange_kind _Kind>
> inline constexpr bool
> enable_borrowed_range<subrange<_It, _Sent, _Kind>> = true;
>
>diff --git a/libstdc++-v3/include/std/ranges b/libstdc++-v3/include/std/ranges
>index f21e08a36e3..2305bd200a5 100644
>--- a/libstdc++-v3/include/std/ranges
>+++ b/libstdc++-v3/include/std/ranges
>@@ -586,7 +586,7 @@ namespace ranges
> == __detail::__is_signed_integer_like<_Bound>))
> iota_view(_Winc, _Bound) -> iota_view<_Winc, _Bound>;
>
>- template<weakly_incrementable _Winc, semiregular _Bound>
>+ template<typename _Winc, typename _Bound>
> inline constexpr bool
> enable_borrowed_range<iota_view<_Winc, _Bound>> = true;
>
>--
>2.31.1.442.g7e39198978
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2021-05-05 9:40 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-05-05 1:42 [PATCH] libstdc++: Don't constrain some enable_borrowed_range specializations Patrick Palka
2021-05-05 9:40 ` 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).