From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: by sourceware.org (Postfix, from userid 2181) id 90D14385842E; Tue, 26 Apr 2022 13:13:01 +0000 (GMT) DKIM-Filter: OpenDKIM Filter v2.11.0 sourceware.org 90D14385842E MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Type: text/plain; charset="utf-8" From: Jonathan Wakely To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org Subject: [gcc r10-10574] libstdc++: Reorder constraints on std::span::span(Range&&) constructor. X-Act-Checkin: gcc X-Git-Author: Jonathan Wakely X-Git-Refname: refs/heads/releases/gcc-10 X-Git-Oldrev: c8f35df75ddfd5bab377721582aafb6a5a1463fe X-Git-Newrev: ba2baf20356befbba6c8d83bbb3676cfee7e146f Message-Id: <20220426131301.90D14385842E@sourceware.org> Date: Tue, 26 Apr 2022 13:13:01 +0000 (GMT) X-BeenThere: libstdc++-cvs@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++-cvs mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Tue, 26 Apr 2022 13:13:01 -0000 https://gcc.gnu.org/g:ba2baf20356befbba6c8d83bbb3676cfee7e146f commit r10-10574-gba2baf20356befbba6c8d83bbb3676cfee7e146f Author: Jonathan Wakely Date: Mon Nov 1 11:32:39 2021 +0000 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: --- libstdc++-v3/include/std/span | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/libstdc++-v3/include/std/span b/libstdc++-v3/include/std/span index 4173446d141..4b389a46af7 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)