[mdspan.layout.stride.expo]

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

## 23.7 Views [[views]](views#mdspan.layout.stride.expo)

### 23.7.3 Multidimensional access [[views.multidim]](views.multidim#mdspan.layout.stride.expo)

#### 23.7.3.4 Layout mapping [[mdspan.layout]](mdspan.layout#stride.expo)

#### 23.7.3.4.7 Class template layout_stride​::​mapping [[mdspan.layout.stride]](mdspan.layout.stride#expo)

#### 23.7.3.4.7.2 Exposition-only helpers [mdspan.layout.stride.expo]

[1](#1)

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

Let *REQUIRED-SPAN-SIZE*(e, strides) be:

- [(1.1)](#1.1)

1, if e.rank() == 0 is true,

- [(1.2)](#1.2)

otherwise 0, if the size of the multidimensional index space e is 0,

- [(1.3)](#1.3)

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())[.](#1.sentence-1)

[2](#2)

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

Let *OFFSET*(m) be:

- [(2.1)](#2.1)

m(), if e.rank() == 0 is true,

- [(2.2)](#2.2)

otherwise 0, if the size of the multidimensional index space e is 0,

- [(2.3)](#2.3)

otherwise m(z...) for a pack of integers z that is a multidimensional index in m.extents() and
each element of z equals 0[.](#2.sentence-1)

[3](#3)

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

Let *is-extents* be the exposition-only variable template
defined as follows:template<class T>constexpr bool *is-extents* = false; // *exposition only*template<class IndexType, size_t... Args>constexpr bool *is-extents*<extents<IndexType, Args...>> = true; // *exposition only*

[4](#4)

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

Let [*layout-mapping-alike*](#concept:layout-mapping-alike "23.7.3.4.7.2 Exposition-only helpers [mdspan.layout.stride.expo]") be the exposition-only concept
defined as follows:template<class M>concept [*layout-mapping-alike*](#concept:layout-mapping-alike "23.7.3.4.7.2 Exposition-only helpers [mdspan.layout.stride.expo]") = requires { // *exposition only*requires *is-extents*<typename M::extents_type>; { M::is_always_strided() } -> [same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<bool>; { M::is_always_exhaustive() } -> [same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<bool>; { M::is_always_unique() } -> [same_as](concept.same#concept:same_as "18.4.2 Concept same_­as [concept.same]")<bool>;
 bool_constant<M::is_always_strided()>::value;
 bool_constant<M::is_always_exhaustive()>::value;
 bool_constant<M::is_always_unique()>::value;};

[*Note [1](#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[.](#4.sentence-1)

â *end note*]
