public inbox for gcc-cvs@sourceware.org
help / color / mirror / Atom feed
From: Jonathan Wakely <redi@gcc.gnu.org>
To: gcc-cvs@gcc.gnu.org, libstdc++-cvs@gcc.gnu.org
Subject: [gcc r10-10574] libstdc++: Reorder constraints on std::span::span(Range&&) constructor.
Date: Tue, 26 Apr 2022 13:13:01 +0000 (GMT)	[thread overview]
Message-ID: <20220426131301.90D14385842E@sourceware.org> (raw)

https://gcc.gnu.org/g:ba2baf20356befbba6c8d83bbb3676cfee7e146f

commit r10-10574-gba2baf20356befbba6c8d83bbb3676cfee7e146f
Author: Jonathan Wakely <jwakely@redhat.com>
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<typename _Range>
-	requires ranges::contiguous_range<_Range> && ranges::sized_range<_Range>
-	  && (ranges::borrowed_range<_Range> || is_const_v<element_type>)
-	  && (!__detail::__is_std_span<remove_cvref_t<_Range>>::value)
+	requires (!__detail::__is_std_span<remove_cvref_t<_Range>>::value)
 	  && (!__detail::__is_std_array<remove_cvref_t<_Range>>::value)
 	  && (!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)


                 reply	other threads:[~2022-04-26 13:13 UTC|newest]

Thread overview: [no followups] expand[flat|nested]  mbox.gz  Atom feed

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20220426131301.90D14385842E@sourceware.org \
    --to=redi@gcc.gnu.org \
    --cc=gcc-cvs@gcc.gnu.org \
    --cc=libstdc++-cvs@gcc.gnu.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).