[mdspan.layout.leftpad.obs]

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

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

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

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

#### 23.7.3.4.8 Class template layout_left_padded​::​mapping [[mdspan.layout.leftpad]](mdspan.layout.leftpad#obs)

#### 23.7.3.4.8.4 Observers [mdspan.layout.leftpad.obs]

[ð](#itemdecl:1)

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

[1](#1)

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

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

[ð](#itemdecl:2)

`constexpr index_type required_span_size() const noexcept;
`

[2](#2)

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

*Returns*: 

- [(2.1)](#2.1)

0 if the multidimensional index space *extents_* is empty,

- [(2.2)](#2.2)

otherwise, *this(((*extents_*(P_rank) - index_type(1))...)) + 1[.](#2.sentence-1)

[ð](#itemdecl:3)

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

[3](#3)

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

*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#L23479)

*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#L23484)

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

[ð](#itemdecl:4)

`static constexpr bool is_always_exhaustive() noexcept;
`

[6](#6)

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

*Returns*: 

- [(6.1)](#6.1)

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

- [(6.2)](#6.2)

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

- [(6.3)](#6.3)

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

[ð](#itemdecl:5)

`constexpr bool is_exhaustive() const noexcept;
`

[7](#7)

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

*Returns*: true if *rank_* equals zero or one;
otherwise, extents_.extent(0) == stride(1)[.](#7.sentence-1)

[ð](#itemdecl:6)

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

[8](#8)

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

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

[9](#9)

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

*Returns*: 

- [(9.1)](#9.1)

If r equals zero: 1;

- [(9.2)](#9.2)

otherwise, if r equals one: *stride-1*;

- [(9.3)](#9.3)

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

[ð](#itemdecl:7)

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

[10](#10)

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

*Constraints*: 

- [(10.1)](#10.1)

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

- [(10.2)](#10.2)

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

[11](#11)

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

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

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