[mdspan.sub.overview]

# 23 Containers library [[containers]](./#containers)

## 23.7 Views [[views]](views#mdspan.sub.overview)

### 23.7.3 Multidimensional access [[views.multidim]](views.multidim#mdspan.sub.overview)

#### 23.7.3.7 submdspan [[mdspan.sub]](mdspan.sub#overview)

#### 23.7.3.7.1 Overview [mdspan.sub.overview]

[1](#1)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25258)

The submdspan facilities create a new mdspan viewing a subset of elements of an existing input mdspan[.](#1.sentence-1)

The subset viewed by the created mdspan is determined by
the SliceSpecifier arguments[.](#1.sentence-2)

[2](#2)

[#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25264)

For each function defined in [[mdspan.sub]](mdspan.sub "23.7.3.7 submdspan") that
takes a parameter pack named slices as an argument:

- [(2.1)](#2.1)

let index_type be
  * [(2.1.1)](#2.1.1)

M​::​index_type if the function is a member of a class M,

  * [(2.1.2)](#2.1.2)

otherwise, remove_reference_t<decltype(src)>​::​index_type if the function has a parameter named src,

  * [(2.1.3)](#2.1.3)

otherwise,
 the same type as the function's template argument IndexType;

- [(2.2)](#2.2)

let rank be the number of elements in slices;

- [(2.3)](#2.3)

let sk be the kth element of slices;

- [(2.4)](#2.4)

let Sk be the type of sk; and

- [(2.5)](#2.5)

let *map-rank* be an array<size_t, rank> such that
for each k in the range [0, rank),*map-rank*[k] equals:
  * [(2.5.1)](#2.5.1)

dynamic_extent if Sk models [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<index_type>,

  * [(2.5.2)](#2.5.2)

otherwise,
 the number of types Sj with j<k that
 do not model [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]")<index_type>[.](#2.sentence-1)
