mirror of
https://gcc.gnu.org/git/gcc.git
synced 2024-12-19 00:55:13 +08:00
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.
This commit is contained in:
parent
679652a77d
commit
09bc98098e
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user