[mdspan.sub.helpers] (original) (raw)

23 Containers library [containers]

23.7 Views [views]

23.7.3 Multidimensional access [views.multidim]

23.7.3.7 submdspan [mdspan.sub]

23.7.3.7.4 Exposition-only helpers [mdspan.sub.helpers]

template<class T> constexpr T _de-ice_(T val) { return val; } template<[_integral-constant-like_](span.syn#concept:integral-constant-like "23.7.2.1 Header <span> synopsis [span.syn]") T> constexpr auto _de-ice_(T) { return T::value; } template<class IndexType, size_t k, class... SliceSpecifiers> constexpr IndexType _first_(SliceSpecifiers... slices);

Mandates: IndexType is a signed or unsigned integer type.

Let denote the following value:

Preconditions: is representable as a value of type IndexType.

Returns: extents<IndexType>​::​index-cast().

template<size_t k, class Extents, class... SliceSpecifiers> constexpr auto _last_(const Extents& src, SliceSpecifiers... slices);

Mandates: Extents is a specialization of extents.

Let index_type be typename Extents​::​index_type.

Let denote the following value:

Preconditions: is representable as a value of type index_type.

Returns: Extents​::​index-cast().

template<class IndexType, size_t N, class... SliceSpecifiers> constexpr array<IndexType, sizeof...(SliceSpecifiers)> _src-indices_(const array<IndexType, N>& indices, SliceSpecifiers... slices);

Mandates: IndexType is a signed or unsigned integer type.

Returns: An array<IndexType, sizeof...(SliceSpecifiers)> src_idx such that for each k in the range [0, sizeof...(SliceSpecifiers)),src_idx[k] equals