24 Containers library [containers]

24.7 Views [views]

24.7.3 Multidimensional access [views.multidim]

24.7.3.7 submdspan [mdspan.sub]

24.7.3.7.4 Exposition-only helpers [mdspan.sub.helpers]

template<class T> constexpr T de-ice(T val) { return val; } template<integral-constant-like T> constexpr auto de-ice(T) { return T::value; } template<class IndexType, size_t k, class... SliceSpecifiers> constexpr IndexType first_(SliceSpecifiers... slices);
Mandates: IndexType is a signed or unsigned integer type.
Let denote the following value:
Preconditions: is representable as a value of type IndexType.
Returns: extents<IndexType>​::​index-cast().
template<size_t k, class Extents, class... SliceSpecifiers> constexpr auto last_(const Extents& src, SliceSpecifiers... slices);
Mandates: Extents is a specialization of extents.
Let index_type be typename Extents​::​index_type.
Let denote the following value:
  • de-ice() + 1 if models convertible_to<index_type>; otherwise
  • get<1>() if models index-pair-like<index_type>; otherwise
  • de-ice(.offset) + de-ice(.extent) if is a specialization of strided_slice; otherwise
  • src.extent(k).
Preconditions: is representable as a value of type index_type.
Returns: Extents​::​index-cast().
template<class IndexType, size_t N, class... SliceSpecifiers> constexpr array<IndexType, sizeof...(SliceSpecifiers)> src-indices(const array<IndexType, N>& indices, SliceSpecifiers... slices);
Mandates: IndexType is a signed or unsigned integer type.
Returns: An array<IndexType, sizeof...(SliceSpecifiers)> src_idx such that for each k in the range [0, sizeof...(SliceSpecifiers)), src_idx[k] equals
  • first_<IndexType, k>(slices...) for each k where map-rank[k] equals dynamic_extent,
  • otherwise, first_<IndexType, k>(slices...) + indices[map-rank[k]].