[mdspan.sub.helpers] # 23 Containers library [[containers]](./#containers) ## 23.7 Views [[views]](views#mdspan.sub.helpers) ### 23.7.3 Multidimensional access [[views.multidim]](views.multidim#mdspan.sub.helpers) #### 23.7.3.7 submdspan [[mdspan.sub]](mdspan.sub#helpers) #### 23.7.3.7.4 Exposition-only helpers [mdspan.sub.helpers] [🔗](#lib:de-ice) `template constexpr T de-ice(T val) { return val; } template<[integral-constant-like](span.syn#concept:integral-constant-like "23.7.2.1 Header synopsis [span.syn]") T> constexpr auto de-ice(T) { return T::value; } template constexpr IndexType first_(SliceSpecifiers... slices); ` [1](#1) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25378) *Mandates*: IndexType is a signed or unsigned integer type[.](#1.sentence-1) [2](#2) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25383) Let ϕk denote the following value: - [(2.1)](#2.1) sk if Sk models [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]"); - [(2.2)](#2.2) otherwise,get<0>(sk) if Sk models [*index-pair-like*](mdspan.syn#concept:index-pair-like "23.7.3.2 Header synopsis [mdspan.syn]"); - [(2.3)](#2.3) otherwise,*de-ice*(sk.offset) if Sk is a specialization of strided_slice; - [(2.4)](#2.4) otherwise,0[.](#2.sentence-1) [3](#3) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25401) *Preconditions*: ϕk is representable as a value of type IndexType[.](#3.sentence-1) [4](#4) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25405) *Returns*: extents​::​*index-cast*(ϕk)[.](#4.sentence-1) [🔗](#lib:last_) `template constexpr auto last_(const Extents& src, SliceSpecifiers... slices); ` [5](#5) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25417) *Mandates*: Extents is a specialization of extents[.](#5.sentence-1) [6](#6) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25421) Let index_type be typename Extents​::​index_type[.](#6.sentence-1) [7](#7) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25425) Let λk denote the following value: - [(7.1)](#7.1) *de-ice*(sk) + 1 if Sk models [convertible_to](concept.convertible#concept:convertible_to "18.4.4 Concept convertible_­to [concept.convertible]"); otherwise - [(7.2)](#7.2) get<1>(sk) if Sk models [*index-pair-like*](mdspan.syn#concept:index-pair-like "23.7.3.2 Header synopsis [mdspan.syn]"); otherwise - [(7.3)](#7.3) *de-ice*(sk.offset) +*de-ice*(sk.extent) if Sk is a specialization of strided_slice; otherwise - [(7.4)](#7.4) src.extent(k)[.](#7.sentence-1) [8](#8) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25443) *Preconditions*: λk is representable as a value of type index_type[.](#8.sentence-1) [9](#9) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25447) *Returns*: Extents​::​*index-cast*(λk)[.](#9.sentence-1) [🔗](#lib:src-indices) `template constexpr array src-indices(const array& indices, SliceSpecifiers... slices); ` [10](#10) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25460) *Mandates*: IndexType is a signed or unsigned integer type[.](#10.sentence-1) [11](#11) [#](http://github.com/Eelis/draft/tree/9adde4bc1c62ec234483e63ea3b70a59724c745a/source/containers.tex#L25464) *Returns*: An array src_idx such that for each k in the range [0, sizeof...(SliceSpecifiers)),src_idx[k] equals - [(11.1)](#11.1) *first_*(slices...) for each k where *map-rank*[k] equalsdynamic_extent, - [(11.2)](#11.2) otherwise,*first_*(slices...) +indices[*map-rank*[k]].