[mdspan.sub.map] (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.6 Specializations of submdspan_mapping [mdspan.sub.map]

23.7.3.7.6.1 Common [mdspan.sub.map.common]

The following elements apply to all functions in [mdspan.sub.map].

Constraints: sizeof...(slices) equals extents_type​::​rank().

Mandates: For each rank index k of extents(), exactly one of the following is true:

Preconditions: For each rank index k of extents(), all of the following are true:

Let sub_ext be the result of submdspan_extents(extents(), slices...) and let SubExtents be decltype(sub_ext).

Let sub_strides be an array<SubExtents​::​index_type, SubExtents​::​rank()>such that for each rank index k of extents()for which _map-rank_[k] is not dynamic_extent,sub_strides[_map-rank_[k]] equals:

Let P be a parameter pack such that is_same_v<make_index_sequence<rank()>, index_sequence<P...>>is true.

If first_<index_type, k>(slices...)equals extents().extent(k)for any rank index k of extents(), then let offset be a value of type size_t equal to(*this).required_span_size().

Otherwise, let offset be a value of type size_t equal to(*this)(first_<index_type, P>(slices...)...).

Given a layout mapping type M, a type S is aunit-stride slice for M if

23.7.3.7.6.2 layout_left specialization of submdspan_mapping [mdspan.sub.map.left]

template<class Extents> template<class... SliceSpecifiers> constexpr auto layout_left::mapping<Extents>::_submdspan-mapping-impl_( SliceSpecifiers... slices) const -> _see below_;

Returns:

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

template<class Extents> template<class... SliceSpecifiers> constexpr auto layout_right::mapping<Extents>::_submdspan-mapping-impl_( SliceSpecifiers... slices) const -> _see below_;

Returns:

23.7.3.7.6.4 layout_stride specialization of submdspan_mapping [mdspan.sub.map.stride]

template<class Extents> template<class... SliceSpecifiers> constexpr auto layout_stride::mapping<Extents>::_submdspan-mapping-impl_( SliceSpecifiers... slices) const -> _see below_;

Returns:

23.7.3.7.6.5 layout_left_padded specialization of submdspan_mapping [mdspan.sub.map.leftpad]

template<class Extents> template<class... SliceSpecifiers> constexpr auto layout_left_padded::mapping<Extents>::_submdspan-mapping-impl_( SliceSpecifiers... slices) const -> _see below_;

Returns:

23.7.3.7.6.6 layout_right_padded specialization of submdspan_mapping [mdspan.sub.map.rightpad]

template<class Extents> template<class... SliceSpecifiers> constexpr auto layout_right_padded::mapping<Extents>::submdspan-mapping-impl( SliceSpecifiers... slices) const -> _see below_;

Returns: