[mdspan.layout.right.cons]

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

## 23.7 Views [[views]](views#mdspan.layout.right.cons)

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

#### 23.7.3.4 Layout mapping [[mdspan.layout]](mdspan.layout#right.cons)

#### 23.7.3.4.6 Class template layout_right​::​mapping [[mdspan.layout.right]](mdspan.layout.right#cons)

#### 23.7.3.4.6.2 Constructors [mdspan.layout.right.cons]

[ð](#lib:layout_right::mapping,constructor)

`constexpr mapping(const extents_type& e) noexcept;
`

[1](#1)

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

*Preconditions*: The size of the multidimensional index space e is representable as
a value of type index_type ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types"))[.](#1.sentence-1)

[2](#2)

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

*Effects*: Direct-non-list-initializes *extents_* with e[.](#2.sentence-1)

[ð](#lib:layout_right::mapping,constructor_)

`template<class OtherExtents>
  constexpr explicit(!is_convertible_v<OtherExtents, extents_type>)
    mapping(const mapping<OtherExtents>& other) noexcept;
`

[3](#3)

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

*Constraints*: is_constructible_v<extents_type, OtherExtents> is true[.](#3.sentence-1)

[4](#4)

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

*Preconditions*: other.required_span_size() is representable as
a value of type index_type ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types"))[.](#4.sentence-1)

[5](#5)

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

*Effects*: Direct-non-list-initializes *extents_* with other.extents()[.](#5.sentence-1)

[ð](#lib:layout_right::mapping,constructor__)

`template<class OtherExtents>
  constexpr explicit(!is_convertible_v<OtherExtents, extents_type>)
    mapping(const layout_left::mapping<OtherExtents>& other) noexcept;
`

[6](#6)

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

*Constraints*: 

- [(6.1)](#6.1)

extents_type​::​rank() <= 1 is true, and

- [(6.2)](#6.2)

is_constructible_v<extents_type, OtherExtents> is true[.](#6.sentence-1)

[7](#7)

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

*Preconditions*: other.required_span_size() is representable as
a value of type index_type ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types"))[.](#7.sentence-1)

[8](#8)

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

*Effects*: Direct-non-list-initializes *extents_* with other.extents()[.](#8.sentence-1)

[ð](#lib:layout_right::mapping,constructor___)

`template<class LayoutRightPaddedMapping>
  constexpr explicit(!is_convertible_v<typename LayoutRightPaddedMapping::extents_type,
                                       extents_type>)
    mapping(const LayoutRightPaddedMapping&) noexcept;
`

[9](#9)

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

*Constraints*: 

- [(9.1)](#9.1)

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

- [(9.2)](#9.2)

  is_constructible_v<extents_type, typename LayoutRightPaddedMapping​::​extents_-  
type> is true[.](#9.2.sentence-1)

[10](#10)

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

*Mandates*: If

- [(10.1)](#10.1)

Extents​::​rank() is greater than one,

- [(10.2)](#10.2)

Extents​::​static_extent(Extents​::​rank() - 1) does not equal dynamic_extent, and

- [(10.3)](#10.3)

LayoutRightPaddedMapping​::​*static-padding-stride* does not equal dynamic_extent,

then Extents​::​static_extent(Extents​::​rank() - 1) equalsLayoutRightPaddedMapping​::​*static-padding-stride*[.](#10.sentence-1)

[11](#11)

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

*Preconditions*: 

- [(11.1)](#11.1)

  If extents_type​::​rank() > 1 is true,
then other.stride(extents_type​::​rank() - 2)  
equalsother.extents().extent(extents_type​::​rank() - 1)[.](#11.1.sentence-1)

- [(11.2)](#11.2)

  other.required_span_size() is representable as
a value of type index_type[.](#11.2.sentence-1)

[12](#12)

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

*Effects*: Direct-non-list-initializes extents_ with other.extents()[.](#12.sentence-1)

[ð](#lib:layout_right::mapping,constructor____)

`template<class OtherExtents>
 constexpr explicit(extents_type::rank() > 0)
    mapping(const layout_stride::mapping<OtherExtents>& other) noexcept;
`

[13](#13)

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

*Constraints*: is_constructible_v<extents_type, OtherExtents> is true[.](#13.sentence-1)

[14](#14)

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

*Preconditions*: 

- [(14.1)](#14.1)

  If extents_type​::​rank() > 0 is true,
then for all r in the range [0, extents_type​::​rank()),other.stride(r) equalsother.extents().*rev-prod-of-extents*(r)[.](#14.1.sentence-1)

- [(14.2)](#14.2)

  other.required_span_size() is representable as
a value of type index_type ([[basic.fundamental]](basic.fundamental "6.9.2 Fundamental types"))[.](#14.2.sentence-1)

[15](#15)

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

*Effects*: Direct-non-list-initializes *extents_* with other.extents()[.](#15.sentence-1)
