|
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}
|
|
19098 | 19114 | const mdspan<ElementType, Extents, LayoutPolicy, AccessorPolicy>& src,
|
19099 | 19115 | SliceSpecifiers... slices) -> @\seebelow@;
|
19100 | 19116 |
|
19101 |
| - template<class T> |
19102 |
| - concept @\defexposconcept{integral-constant-like}@ = // \expos |
19103 |
| - is_integral_v<decltype(T::value)> && |
19104 |
| - !is_same_v<bool, remove_const_t<decltype(T::value)>> && |
19105 |
| - @\libconcept{convertible_to}@<T, decltype(T::value)> && |
19106 |
| - @\libconcept{equality_comparable_with}@<T, decltype(T::value)> && |
19107 |
| - bool_constant<T() == T::value>::value && |
19108 |
| - bool_constant<static_cast<decltype(T::value)>(T()) == T::value>::value; |
19109 |
| - |
19110 | 19117 | template<class T, class IndexType>
|
19111 | 19118 | concept @\defexposconcept{index-pair-like}@ = // \expos
|
19112 | 19119 | @\exposconcept{pair-like}@<T> &&
|
|
19458 | 19465 |
|
19459 | 19466 | \pnum
|
19460 | 19467 | \remarks
|
19461 |
| -The deduced type is \tcode{dextents<size_t, sizeof...(Integrals)>}. |
| 19468 | +The deduced type is \tcode{extents<size_t, \exposconcept{maybe-static-ext}<Integrals>...>}. |
19462 | 19469 | \end{itemdescr}
|
19463 | 19470 |
|
19464 | 19471 | \rSec4[mdspan.extents.obs]{Observers of the multidimensional index space}
|
|
22549 | 22556 | template<class ElementType, class... Integrals>
|
22550 | 22557 | requires ((is_convertible_v<Integrals, size_t> && ...) && sizeof...(Integrals) > 0)
|
22551 | 22558 | explicit mdspan(ElementType*, Integrals...)
|
22552 |
| - -> mdspan<ElementType, dextents<size_t, sizeof...(Integrals)>>; |
| 22559 | + -> mdspan<ElementType, extents<size_t, @\exposconcept{maybe-static-ext}@<Integrals>...>>; |
22553 | 22560 |
|
22554 | 22561 | template<class ElementType, class OtherIndexType, size_t N>
|
22555 | 22562 | mdspan(ElementType*, span<OtherIndexType, N>)
|
|
0 commit comments