aboutsummaryrefslogtreecommitdiff
path: root/libstdc++-v3/include/std/span
diff options
context:
space:
mode:
authorJonathan Wakely <jwakely@redhat.com>2021-11-01 11:32:39 +0000
committerJonathan Wakely <jwakely@redhat.com>2021-11-01 21:01:31 +0000
commit09bc98098e4ad474d2ba9da52457b29bbd08874b (patch)
tree46447fbae64e1bcc66454c2e9180ebace5b9a729 /libstdc++-v3/include/std/span
parent679652a77da60078392a834ed4b6b910127dbf24 (diff)
downloadgcc-09bc98098e4ad474d2ba9da52457b29bbd08874b.zip
gcc-09bc98098e4ad474d2ba9da52457b29bbd08874b.tar.gz
gcc-09bc98098e4ad474d2ba9da52457b29bbd08874b.tar.bz2
libstdc++: Reorder constraints on std::span::span(Range&&) constructor.
In PR libstdc++/103013 Tim Song pointed out that we could reorder the constraints of this constructor. That's worth doing just to reduce the work the compiler has to do during overload resolution, even if it isn't needed to make the code in the PR work. libstdc++-v3/ChangeLog: * include/std/span (span(Range&&)): Reorder constraints.
Diffstat (limited to 'libstdc++-v3/include/std/span')
-rw-r--r--libstdc++-v3/include/std/span6
1 files changed, 3 insertions, 3 deletions
diff --git a/libstdc++-v3/include/std/span b/libstdc++-v3/include/std/span
index 61824de..0898ea8 100644
--- a/libstdc++-v3/include/std/span
+++ b/libstdc++-v3/include/std/span
@@ -201,11 +201,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION
{ }
template<typename _Range>
- requires ranges::contiguous_range<_Range> && ranges::sized_range<_Range>
- && (ranges::borrowed_range<_Range> || is_const_v<element_type>)
- && (!__detail::__is_span<remove_cvref_t<_Range>>)
+ requires (!__detail::__is_span<remove_cvref_t<_Range>>)
&& (!__detail::__is_std_array<remove_cvref_t<_Range>>)
&& (!is_array_v<remove_cvref_t<_Range>>)
+ && ranges::contiguous_range<_Range> && ranges::sized_range<_Range>
+ && (ranges::borrowed_range<_Range> || is_const_v<element_type>)
&& __is_compatible_ref<ranges::range_reference_t<_Range>>::value
constexpr explicit(extent != dynamic_extent)
span(_Range&& __range)