3.0 KiB
[mdspan.layout.stride.expo]
23 Containers library [containers]
23.7 Views [views]
23.7.3 Multidimensional access [views.multidim]
23.7.3.4 Layout mapping [mdspan.layout]
23.7.3.4.7 Class template layout_stride::mapping [mdspan.layout.stride]
23.7.3.4.7.2 Exposition-only helpers [mdspan.layout.stride.expo]
Let REQUIRED-SPAN-SIZE(e, strides) be:
1, if e.rank() == 0 is true,
otherwise 0, if the size of the multidimensional index space e is 0,
otherwise 1 plus the sum of products of(e.extent(r) - 1) andextents_type::index-cast(strides[r]) for all r in the range [0, e.rank()).
Let OFFSET(m) be:
m(), if e.rank() == 0 is true,
otherwise 0, if the size of the multidimensional index space e is 0,
otherwise m(z...) for a pack of integers z that is a multidimensional index in m.extents() and each element of z equals 0.
Let is-extents be the exposition-only variable template defined as follows:templateconstexpr bool is-extents = false; // exposition onlytemplate<class IndexType, size_t... Args>constexpr bool is-extents<extents<IndexType, Args...>> = true; // exposition only
Let layout-mapping-alike be the exposition-only concept defined as follows:templateconcept layout-mapping-alike = requires { // exposition onlyrequires is-extents; { M::is_always_strided() } -> same_as; { M::is_always_exhaustive() } -> same_as; { M::is_always_unique() } -> same_as; bool_constant<M::is_always_strided()>::value; bool_constant<M::is_always_exhaustive()>::value; bool_constant<M::is_always_unique()>::value;};
[Note 1:
This concept checks that the functionsM::is_always_strided(),M::is_always_exhaustive(), andM::is_always_unique() exist, are constant expressions, and have a return type of bool.
â end note]