std::extents<IndexType,Extents...>::extents - cppreference.com
From cppreference.com
|
|
(1) | (since C++23) |
|
|
(2) | (since C++23) |
|
|
(3) | (since C++23) |
|
|
(4) | (since C++23) |
|
|
(5) | (since C++23) |
Construct an extents. One can construct extents from just dynamic extents, which are all the values getting stored, or from all the extents with a precondition.
1) Default constructor. Initializes all dynamic extents to zero.
2) Conversion from another extents object. After construction, *this == other is true.
- The behavior is undefined if
other.extent(r) != static_extent(r)for anyrfor whichstatic_extent(r)represents a static extent, orother.extent(r)is not representable as a value of typeIndexTypefor any rank valuerinother.
- This overload participates in overload resolution only if
sizeof...(OtherExtents) == rank()istrue, and((OtherExtents == std::dynamic_extent || Extents == std::dynamic_extent ||OtherExtents == Extents) && ...)istrue.
- This constructor is
explicitif
((Extents != std::dynamic_extent && OtherExtents == std::dynamic_extent) || ...)istrue, orstd::numeric_limits<IndexType>::max() < std::numeric_limits<OtherIndexType>::max()istrue.
3) Let N be sizeof...(exts) and exts_arr be std::array<IndexType, N>{static_cast<IndexType>(std::move(exts))...}, equivalent to extents(exts_arr).
- This overload participates in overload resolution only if
(std::is_convertible_v<OtherIndexTypes, IndexType> && ...)istrue,(std::is_nothrow_constructible_v<IndexType, OtherIndexTypes> && ...)istrue, andN == rank_dynamic() || N == rank()istrue.
- The behavior is undefined if
N != rank_dynamic()andexts_arr[r]is not equal tostatic_extent(r)for anyrfor whichstatic_extent(r)represents a static extent, or- an element in
extsis negative or not representable as a value of typeIndexType.
4,5) If N equals rank_dynamic(), for all d in [0, rank_dynamic()), direct-non-list-initializes dynamic-extents[d] with std::as_const(exts[d]). Otherwise, for all d in [0, rank_dynamic()), direct-non-list-initializes dynamic-extents[d] with std::as_const(exts[dynamic-index-inv(d)]).
- This overload participates in overload resolution only if
std::is_convertible_v<const OtherIndexType&, IndexType>istrue,std::is_nothrow_constructible_v<IndexType, const OtherIndexType&>istrue, andN == rank_dynamic() || N == rank()istrue.
- The behavior is undefined if
N != rank_dynamic()andexts[r]is not equal tostatic_extent(r)for anyrfor whichstatic_extent(r)represents a static extent, orexts[r]is negative or not representable as a value of typeIndexTypefor any rank indexr.
Parameters
| other | - | another extents to convert from
|
| exts | - | represents the extents |