24 Containers library [containers]

24.7 Views [views]

24.7.3 Multidimensional access [views.multidim] submdspan [mdspan.sub] Specializations of submdspan_mapping [mdspan.sub.map] Common [mdspan.sub.map.common]

The following elements apply to all functions in [mdspan.sub.map].
Constraints: sizeof...(slices) equals extents_type​::​rank().
Mandates: For each rank index k of extents(), exactly one of the following is true:
Preconditions: For each rank index k of extents(), all of the following are true:
  • if is a specialization of strided_slice, .extent is equal to zero or .stride is greater than zero; and
  • 0  ≤ first_<index_type, k>(slices...)
    0  ≤ last_<k>(extents(), slices...)
    0  ≤ extents().extent(k)
Let sub_ext be the result of submdspan_extents(extents(), slices...) and let SubExtents be decltype(sub_ext).
Let sub_strides be an array<SubExtents​::​index_type, SubExtents​::​rank()> such that for each rank index k of extents() for which map-rank[k] is not dynamic_extent, sub_strides[map-rank[k]] equals:
  • stride(k) * de-ice(.stride) if is a specialization of strided_slice and .stride < .
    is true;
  • otherwise, stride(k).
Let P be a parameter pack such that is_same_v<make_index_sequence<rank()>, index_sequence<P...>> is true.
Let offset be a value of type size_t equal to (*this)(first_<index_type, P>(slices...)...).