[mdspan.layout.stride.obs]

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

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

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

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

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

#### 23.7.3.4.7.4 Observers [mdspan.layout.stride.obs]

[ð](#lib:required_span_size,layout_stride::mapping)

`constexpr index_type required_span_size() const noexcept;
`

[1](#1)

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

*Returns*: *REQUIRED-SPAN-SIZE*(extents(), *strides_*)[.](#1.sentence-1)

[ð](#lib:operator(),layout_stride::mapping)

`template<class... Indices>
  constexpr index_type operator()(Indices... i) const noexcept;
`

[2](#2)

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

*Constraints*: 

- [(2.1)](#2.1)

sizeof...(Indices) == *rank_* is true,

- [(2.2)](#2.2)

(is_convertible_v<Indices, index_type> && ...) is true, and

- [(2.3)](#2.3)

(is_nothrow_constructible_v<index_type, Indices> && ...) is true[.](#2.sentence-1)

[3](#3)

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

*Preconditions*: extents_type​::​*index-cast*(i) is
a multidimensional index in *extents_* ([[mdspan.overview]](mdspan.overview "23.7.3.1 Overview"))[.](#3.sentence-1)

[4](#4)

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

*Effects*: Let P be a parameter pack such thatis_same_v<index_sequence_for<Indices...>, index_sequence<P...>> is true[.](#4.sentence-1)

Equivalent to:return ((static_cast<index_type>(i) * stride(P)) + ... + 0);

[ð](#lib:is_exhaustive,layout_stride::mapping)

`constexpr bool is_exhaustive() const noexcept;
`

[5](#5)

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

*Returns*: 

- [(5.1)](#5.1)

  true if *rank_* is 0[.](#5.1.sentence-1)

- [(5.2)](#5.2)

  Otherwise, true if there is
a permutation P of the integers in the range [0, *rank_*) such that stride(p0) equals 1, andstride(pi) equals stride(piâ1) * extents().extent(piâ1) for i in the range [1, *rank_*),
where pi is the ith element of P[.](#5.2.sentence-1)

- [(5.3)](#5.3)

  Otherwise, false[.](#5.3.sentence-1)

[ð](#lib:operator==,layout_stride::mapping)

`template<class OtherMapping>
  friend constexpr bool operator==(const mapping& x, const OtherMapping& y) noexcept;
`

[6](#6)

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

*Constraints*: 

- [(6.1)](#6.1)

  [*layout-mapping-alike*](mdspan.layout.stride.expo#concept:layout-mapping-alike "23.7.3.4.7.2 Exposition-only helpers [mdspan.layout.stride.expo]")<OtherMapping> is satisfied[.](#6.1.sentence-1)

- [(6.2)](#6.2)

  *rank_* == OtherMapping​::​extents_type​::​rank() is true[.](#6.2.sentence-1)

- [(6.3)](#6.3)

  OtherMapping​::​is_always_strided() is true[.](#6.3.sentence-1)

[7](#7)

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

*Preconditions*: OtherMapping meets the layout mapping requirements ([[mdspan.layout.policy.reqmts]](mdspan.layout.policy.reqmts "23.7.3.4.3 Layout mapping policy requirements"))[.](#7.sentence-1)

[8](#8)

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

*Returns*: true if x.extents() == y.extents() is true,*OFFSET*(y) == 0 is true, and
each of x.stride(r) == y.stride(r) is true for r in the range [0, x.extents().rank())[.](#8.sentence-1)

Otherwise, false[.](#8.sentence-2)
