[mdspan.sub.map.right]

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

## 23.7 Views [[views]](views#mdspan.sub.map.right)

### 23.7.3 Multidimensional access [[views.multidim]](views.multidim#mdspan.sub.map.right)

#### 23.7.3.7 submdspan [[mdspan.sub]](mdspan.sub#map.right)

#### 23.7.3.7.6 Specializations of submdspan_mapping [[mdspan.sub.map]](mdspan.sub.map#right)

#### 23.7.3.7.6.3 layout_right specialization of submdspan_mapping [mdspan.sub.map.right]

[ð](#lib:layout_right::mapping,submdspan-mapping-impl)

`template<class Extents>
template<class... SliceSpecifiers>
constexpr auto layout_right::mapping<Extents>::submdspan-mapping-impl(
      SliceSpecifiers... slices) const -> see below;
`

[1](#1)

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

*Returns*: 

- [(1.1)](#1.1)

submdspan_mapping_result{*this, 0},
if Extents​::​rank() == 0 is true;

- [(1.2)](#1.2)

otherwise,submdspan_mapping_result{layout_right​::​mapping(sub_ext), offset},
if SubExtents​::​rank() == 0 is true;

- [(1.3)](#1.3)

otherwise,submdspan_mapping_result{layout_left​::​mapping(sub_ext), offset},
if
  * [(1.3.1)](#1.3.1)

for each k in the range [*rank_* - SubExtents​::​rank() + 1, *rank_*), is_convertible_v<Sk, full_extent_t> is true; and

  * [(1.3.2)](#1.3.2)

for k equal to *_rank* - SubExtents​::​rank(), Sk is a unit-stride slice for mapping;

  [*Note [1](#note-1)*:
  If the above conditions are true,
all Sk with k<_rankÂ - SubExtents::rank() are convertible to index_type[.](#1.3.sentence-1)
 â *end note*]

- [(1.4)](#1.4)

otherwise,submdspan_mapping_result{layout_right_padded<S_static>::mapping(sub_ext,
 stride(*rank_* - u - 2)), offset} if for a value u for which rank_âuâ2 is
the largest value p smaller than *rank_* - 1 for which Sp is a unit-stride slice for mapping,
the following conditions are met:
  * [(1.4.1)](#1.4.1)

for k equal to *rank_* - 1,Sk is a unit-stride slice for mapping; and

  * [(1.4.2)](#1.4.2)

for each k in the range
[*rank_* - SubExtents​::​rank() - u + 1, *rank_* - u - 1),is_convertible_v<Sk, full_extent_t> is true; and

  * [(1.4.3)](#1.4.3)

for k equal to *rank_* - SubExtents​::​rank() - u,  
Sk is a unit-stride slice for mapping;

and where S_static is:
  * [(1.4.4)](#1.4.4)

dynamic_extent,
if static_extent(k) is dynamic_extent for any k in the range [*rank_* - u - 1, *rank_*),

  * [(1.4.5)](#1.4.5)

otherwise, the product of all valuesstatic_extent(k) for k in the range [*rank_* - u - 1, *rank_*);

- [(1.5)](#1.5)

otherwise,submdspan_mapping_result{layout_stride::mapping(sub_ext, sub_strides), offset}
