public inbox for libstdc++-cvs@sourceware.org
help / color / mirror / Atom feed
* [gcc r12-4833] libstdc++: Reorder constraints on std::span::span(Range&&) constructor.
@ 2021-11-01 23:51 Jonathan Wakely
  0 siblings, 0 replies; only message in thread
From: Jonathan Wakely @ 2021-11-01 23:51 UTC (permalink / raw)
  To: gcc-cvs, libstdc++-cvs

https://gcc.gnu.org/g:09bc98098e4ad474d2ba9da52457b29bbd08874b

commit r12-4833-g09bc98098e4ad474d2ba9da52457b29bbd08874b
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.

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 61824dee845..0898ea85c50 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)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2021-11-01 23:51 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-11-01 23:51 [gcc r12-4833] libstdc++: Reorder constraints on std::span::span(Range&&) constructor Jonathan Wakely

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).