23 Containers library [containers]

23.7 Views [views]

23.7.3 Multidimensional access [views.multidim]

23.7.3.7 submdspan [mdspan.sub]

23.7.3.7.6 subextents function [mdspan.sub.extents]

template<class IndexType, size_t... Extents, class... SliceSpecifiers> constexpr auto subextents(const extents<IndexType, Extents...>& src, SliceSpecifiers... raw_slices);
Let slices be the pack introduced by the following declaration: auto [...slices] = canonical_slices(src, raw_slices...);
Constraints: sizeof...(SliceSpecifiers) equals sizeof...(Extents).
Mandates: For each rank index k of src:
  • SliceSpecifiers...[k] is a submdspan slice type for IndexType, and
  • decltype(slices...[k]) is a valid submdspan slice type for the extent of extents<​IndexType, Extents...>.
Preconditions: For each rank index k of src, slices...[k] is a valid submdspan slice for the extent of src.
Let SubExtents be a specialization of extents such that:
  • SubExtents​::​rank() equals MAP_RANK(slices, Extents​::​rank()); and
  • for each rank index k of extents<IndexType, Extents...> such that the type of slices...[k] is not a collapsing slice type, SubExtents​::​static_extent(MAP_RANK(slices, k)) equals the following, where denotes the type of slices...[k]:
    • Extents​::​static_extent(k) if denotes full_extent_t; otherwise
    • ​::​extent_type​::​value if is a specialization of extent_slice whose extent_type denotes a specialization of constant_wrapper;
    • otherwise, dynamic_extent.
Returns: A value ext of type SubExtents such that for each rank index k of extents<IndexType, Extents...>, where the type of slices...[k] is not a collapsing slice type, ext.extent(MAP_RANK(slices, k)) equals the following, where denotes slices...[k]:
  • .extent if the type of is a specialization of extent_slice,
  • otherwise, , where [L, U) is the submdspan slice range of for the extent of src.