From: Jonathan Wakely Date: Mon, 1 Nov 2021 11:32:39 +0000 (+0000) Subject: libstdc++: Reorder constraints on std::span::span(Range&&) constructor. X-Git-Tag: releases/gcc-10.4.0~297 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=ba2baf20356befbba6c8d83bbb3676cfee7e146f;p=thirdparty%2Fgcc.git 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. (cherry picked from commit 09bc98098e4ad474d2ba9da52457b29bbd08874b) --- diff --git a/libstdc++-v3/include/std/span b/libstdc++-v3/include/std/span index 4173446d1419..4b389a46af7b 100644 --- a/libstdc++-v3/include/std/span +++ b/libstdc++-v3/include/std/span @@ -204,11 +204,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { } template - requires ranges::contiguous_range<_Range> && ranges::sized_range<_Range> - && (ranges::borrowed_range<_Range> || is_const_v) - && (!__detail::__is_std_span>::value) + requires (!__detail::__is_std_span>::value) && (!__detail::__is_std_array>::value) && (!is_array_v>) + && ranges::contiguous_range<_Range> && ranges::sized_range<_Range> + && (ranges::borrowed_range<_Range> || is_const_v) && __is_compatible_ref>::value constexpr explicit(extent != dynamic_extent) span(_Range&& __range)