[mdspan.layout.general]

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

## 23.7 Views [[views]](views#mdspan.layout.general)

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

#### 23.7.3.4 Layout mapping [[mdspan.layout]](mdspan.layout#general)

#### 23.7.3.4.1 General [mdspan.layout.general]

[1](#1)

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

In [[mdspan.layout.reqmts]](mdspan.layout.reqmts "23.7.3.4.2 Requirements") and [[mdspan.layout.policy.reqmts]](mdspan.layout.policy.reqmts "23.7.3.4.3 Layout mapping policy requirements"):

- [(1.1)](#1.1)

  M denotes a layout mapping class[.](#1.1.sentence-1)

- [(1.2)](#1.2)

  m denotes a (possibly const) value of type M[.](#1.2.sentence-1)

- [(1.3)](#1.3)

  i and j are packs of (possibly const) integers
that are multidimensional indices in m.extents() ([[mdspan.overview]](mdspan.overview "23.7.3.1 Overview"))[.](#1.3.sentence-1)
  [*Note [1](#note-1)*:
  The type of each element of the packs can be a different integer type[.](#1.3.sentence-2)
 â *end note*]

- [(1.4)](#1.4)

  r is a (possibly const) rank index of typename M​::​extents_type[.](#1.4.sentence-1)

- [(1.5)](#1.5)

  dr is a pack of (possibly const) integers
for which sizeof...(dr) == M​::​extents_type​::​rank() is true,
the rth element is equal to 1, and
all other elements are equal to 0[.](#1.5.sentence-1)

[2](#2)

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

In [[mdspan.layout.reqmts]](mdspan.layout.reqmts "23.7.3.4.2 Requirements") through [[mdspan.layout.stride]](mdspan.layout.stride "23.7.3.4.7 Class template layout_­stride​::​mapping"):

- [(2.1)](#2.1)

Let *is-mapping-of* be the exposition-only variable template defined as follows:template<class Layout, class Mapping>constexpr bool *is-mapping-of* = // *exposition only* is_same_v<typename Layout::template mapping<typename Mapping::extents_type>, Mapping>;

- [(2.2)](#2.2)

Let *is-layout-left-padded-mapping-of* be
the exposition-only variable template defined as follows:template<class Mapping>constexpr bool *is-layout-left-padded-mapping-of* = *see below*; // *exposition only* where *is-layout-left-padded-mapping-of*<Mapping> is true if and only if Mapping denotes
a specialization of layout_left_padded<S>​::​mapping for some value S of type size_t.

- [(2.3)](#2.3)

Let *is-layout-right-padded-mapping-of* be
the exposition-only variable template defined as follows:template<class Mapping>constexpr bool *is-layout-right-padded-mapping-of* = *see below*; // *exposition only* where *is-layout-right-padded-mapping-of*<Mapping> is true if and only if Mapping denotes
a specialization of layout_right_padded<S>​::​mapping for some value S of type size_t.

- [(2.4)](#2.4)

For nonnegative integers x and y,
let LEAST-MULTIPLE-AT-LEAST(x,y) denote
  * [(2.4.1)](#2.4.1)

y if x is zero,

  * [(2.4.2)](#2.4.2)

otherwise, the least multiple of x that is greater than or equal to y.
