|
18228 | 18228 | // constants
|
18229 | 18229 | inline constexpr size_t @\libglobal{dynamic_extent}@ = numeric_limits<size_t>::max();
|
18230 | 18230 |
|
| 18231 | + template<class T> |
| 18232 | + concept @\defexposconcept{integral-constant-like}@ = // \expos |
| 18233 | + is_integral_v<decltype(T::value)> && |
| 18234 | + !is_same_v<bool, remove_const_t<decltype(T::value)>> && |
| 18235 | + @\libconcept{convertible_to}@<T, decltype(T::value)> && |
| 18236 | + @\libconcept{equality_comparable_with}@<T, decltype(T::value)> && |
| 18237 | + bool_constant<T() == T::value>::value && |
| 18238 | + bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value; |
| 18239 | + |
| 18240 | + template<class T> |
| 18241 | + constexpr size_t @\defexposconcept{maybe-static-ext}@ = dynamic_extent; // \expos |
| 18242 | + template<@\exposconcept{integral-constant-like}@ T> |
| 18243 | + constexpr size_t @\exposconcept{maybe-static-ext}@<T> = {T::value}; |
| 18244 | + |
18231 | 18245 | // \ref{views.span}, class template \tcode{span}
|
18232 | 18246 | template<class ElementType, size_t Extent = dynamic_extent>
|
18233 | 18247 | class span; // partially freestanding
|
|
18343 | 18357 | };
|
18344 | 18358 |
|
18345 | 18359 | template<class It, class EndOrSize>
|
18346 |
| - span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>>; |
| 18360 | + span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>, |
| 18361 | + @\exposconcept{maybe-static-ext}@<EndOrSize>>; |
18347 | 18362 | template<class T, size_t N>
|
18348 | 18363 | span(T (&)[N]) -> span<T, N>;
|
18349 | 18364 | template<class T, size_t N>
|
|
18635 | 18650 | \indexlibrary{\idxcode{span}!deduction guide}%
|
18636 | 18651 | \begin{itemdecl}
|
18637 | 18652 | template<class It, class EndOrSize>
|
18638 |
| - span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>>; |
| 18653 | + span(It, EndOrSize) -> span<remove_reference_t<iter_reference_t<It>>, |
| 18654 | + @\exposconcept{maybe-static-ext}@<EndOrSize>>; |
18639 | 18655 | \end{itemdecl}
|
18640 | 18656 |
|
18641 | 18657 | \begin{itemdescr}
|
|
19082 | 19098 | const mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>& src,
|
19083 | 19099 | SliceSpecifiers... slices) -> @\seebelow@;
|
19084 | 19100 |
|
19085 |
| - template<class T> |
19086 |
| - concept @\defexposconcept{integral-constant-like}@ = // \expos |
19087 |
| - is_integral_v<decltype(T::value)> && |
19088 |
| - !is_same_v<bool, remove_const_t<decltype(T::value)>> && |
19089 |
| - @\libconcept{convertible_to}@<T, decltype(T::value)> && |
19090 |
| - @\libconcept{equality_comparable_with}@<T, decltype(T::value)> && |
19091 |
| - bool_constant<T() == T::value>::value && |
19092 |
| - bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value; |
19093 |
| - |
19094 | 19101 | template<class T, class IndexType>
|
19095 | 19102 | concept @\defexposconcept{index-pair-like}@ = // \expos
|
19096 | 19103 | @\exposconcept{pair-like}@<T> &&
|
|
19442 | 19449 |
|
19443 | 19450 | \pnum
|
19444 | 19451 | \remarks
|
19445 |
| -The deduced type is \tcode{dextents<size_t, sizeof...(Integrals)>}. |
| 19452 | +The deduced type is \tcode{extents<size_t, \exposconcept{maybe-static-ext}<Integrals>...>}. |
19446 | 19453 | \end{itemdescr}
|
19447 | 19454 |
|
19448 | 19455 | \rSec4[mdspan.extents.obs]{Observers of the multidimensional index space}
|
|
21116 | 21123 | template<class ElementType, class... Integrals>
|
21117 | 21124 | requires ((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0)
|
21118 | 21125 | explicit mdspan(ElementType*, Integrals...)
|
21119 |
| - -> mdspan<ElementType, dextents<size_t, sizeof...(Integrals)>>; |
| 21126 | + -> mdspan<ElementType, dextents<size_t, @\exposconcept{maybe-static-ext}@<Integrals>...>>; |
21120 | 21127 |
|
21121 | 21128 | template<class ElementType, class OtherIndexType, size_t N>
|
21122 | 21129 | mdspan(ElementType*, span<OtherIndexType, N>)
|
|
0 commit comments