From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from us-smtp-delivery-124.mimecast.com (us-smtp-delivery-124.mimecast.com [170.10.129.124]) by sourceware.org (Postfix) with ESMTPS id 104BA3858000 for ; Mon, 1 Nov 2021 23:51:42 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.4.1 sourceware.org 104BA3858000 Received: from mimecast-mx01.redhat.com (mimecast-mx01.redhat.com [209.132.183.4]) (Using TLS) by relay.mimecast.com with ESMTP id us-mta-141-HxLe9hSnNdWepatTj3Asew-1; Mon, 01 Nov 2021 19:51:40 -0400 X-MC-Unique: HxLe9hSnNdWepatTj3Asew-1 Received: from smtp.corp.redhat.com (int-mx05.intmail.prod.int.phx2.redhat.com [10.5.11.15]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mimecast-mx01.redhat.com (Postfix) with ESMTPS id 8F76191271; Mon, 1 Nov 2021 23:51:39 +0000 (UTC) Received: from localhost (unknown [10.33.36.17]) by smtp.corp.redhat.com (Postfix) with ESMTP id 3FEEE5F4EE; Mon, 1 Nov 2021 23:51:39 +0000 (UTC) From: Jonathan Wakely To: libstdc++@gcc.gnu.org, gcc-patches@gcc.gnu.org Subject: [committed] libstdc++: Reorder constraints on std::span::span(Range&&) constructor. Date: Mon, 1 Nov 2021 23:51:38 +0000 Message-Id: <20211101235138.1457165-1-jwakely@redhat.com> MIME-Version: 1.0 X-Scanned-By: MIMEDefang 2.79 on 10.5.11.15 X-Mimecast-Spam-Score: 0 X-Mimecast-Originator: redhat.com Content-Transfer-Encoding: 8bit Content-Type: text/plain; charset="US-ASCII" X-Spam-Status: No, score=-14.1 required=5.0 tests=BAYES_00, DKIMWL_WL_HIGH, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H4, RCVD_IN_MSPIKE_WL, SPF_HELO_NONE, SPF_NONE, TXREP autolearn=ham autolearn_force=no version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on server2.sourceware.org X-BeenThere: libstdc++@gcc.gnu.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Libstdc++ mailing list List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 01 Nov 2021 23:51:43 -0000 Tested powerpc64le-linux, pushed to trunk. 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. --- 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 61824dee845..0898ea85c50 100644 --- a/libstdc++-v3/include/std/span +++ b/libstdc++-v3/include/std/span @@ -201,11 +201,11 @@ _GLIBCXX_BEGIN_NAMESPACE_VERSION { } template - requires ranges::contiguous_range<_Range> && ranges::sized_range<_Range> - && (ranges::borrowed_range<_Range> || is_const_v) - && (!__detail::__is_span>) + requires (!__detail::__is_span>) && (!__detail::__is_std_array>) && (!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) -- 2.31.1