[mdspan.layout.rightpad.obs]

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

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

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

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

#### 23.7.3.4.9 Class template layout_right_padded​::​mapping [[mdspan.layout.rightpad]](mdspan.layout.rightpad#obs)

#### 23.7.3.4.9.4 Observers [mdspan.layout.rightpad.obs]

[ð](#lib:layout_right_padded::mapping,strides)

`constexpr array<index_type, rank_> strides() const noexcept;
`

[1](#1)

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

*Returns*: array<index_type, *rank_*>(stride(P_rank)...)[.](#1.sentence-1)

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

`constexpr index_type required_span_size() const noexcept;
`

[2](#2)

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

*Returns*: 0 if the multidimensional index space *extents_* is empty,
otherwise *this(((*extents_*(P_rank) - index_type(1))...)) + 1[.](#2.sentence-1)

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

`template<class... Indices>
constexpr size_t operator()(Indices... idxs) const noexcept;
`

[3](#3)

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

*Constraints*: 

- [(3.1)](#3.1)

  sizeof...(Indices) == *rank_* is true[.](#3.1.sentence-1)

- [(3.2)](#3.2)

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

- [(3.3)](#3.3)

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

[4](#4)

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

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

[5](#5)

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

*Returns*: ((static_cast<index_type>(idxs) * stride(P_rank)) + ... + 0)[.](#5.sentence-1)

[ð](#lib:layout_right_padded::mapping,is_always_exhaustive)

`static constexpr bool is_always_exhaustive() noexcept;
`

[6](#6)

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

*Returns*: 

- [(6.1)](#6.1)

If *rank_* equals zero or one, then true;

- [(6.2)](#6.2)

otherwise,
if neither *static-padding-stride* nor *last-static-extent* equal dynamic_extent,
then *static-padding-stride* == *last-static-extent*;

- [(6.3)](#6.3)

otherwise, false[.](#6.sentence-1)

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

`constexpr bool is_exhaustive() const noexcept;
`

[7](#7)

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

*Returns*: true if *rank_* equals zero or one;
otherwise,*extents_*.extent(*rank_* - 1) == stride(*rank_* - 2)

[ð](#itemdecl:6)

`constexpr index_type stride(rank_type r) const noexcept;
`

[8](#8)

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

*Preconditions*: r is smaller than *rank_*[.](#8.sentence-1)

[9](#9)

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

*Returns*: 

- [(9.1)](#9.1)

If r equals *rank_* - 1: 1;

- [(9.2)](#9.2)

otherwise, if r equals *rank_* - 2: *stride-rm2*;

- [(9.3)](#9.3)

otherwise,
the product of *stride-rm2* and
all values extents_.extent(k) with k in the range of [r + 1, *rank_* - 1)[.](#9.sentence-1)

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

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

[10](#10)

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

*Constraints*: 

- [(10.1)](#10.1)

  *is-layout-right-padded-mapping-of*<LayoutRightPaddedMapping> is true[.](#10.1.sentence-1)

- [(10.2)](#10.2)

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

[11](#11)

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

*Returns*: true if x.extents() == y.extents() is true and*rank_* < 2 || x.stride(*rank_* - 2) == y.stride(*rank_* - 2) is true[.](#11.sentence-1)

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