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

23.7.3.7.7.4 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:
  • submdspan_mapping_result{*this, 0}, if Extents​::​rank() == 0 is true;
  • otherwise, submdspan_mapping_result{layout_right​::​mapping(sub_ext), offset},
    if SubExtents​::​rank() == 0 is true;
  • otherwise, submdspan_mapping_result{layout_right​::​mapping(sub_ext), offset}, if
    • for each k in the range [rank_ - SubExtents​::​rank() + 1, rank_),
      SliceSpecifiers...[k] denotes full_extent_t; and
    • for k equal to rank_ - SubExtents​::​rank(), SliceSpecifiers...[k] is a unit-stride slice type;
    [Note 1: 
    If the above conditions are true, all SliceSpecifiers...[k] with
    are convertible to index_type.
    — end note]
  • otherwise, submdspan_mapping_result{layout_right_padded<S_static>::mapping(sub_ext, stride(rank_ - u - 2)), offset} if for a value u for which is the largest value p smaller than rank_ - 1 for which SliceSpecifiers...[p] is a unit-stride slice type, the following conditions are met:
    • for k equal to rank_ - 1, SliceSpecifiers...[k] is a unit-stride slice type; and
    • for each k in the range [rank_ - SubExtents​::​rank() - u + 1, rank_ - u - 1),
      SliceSpecifiers...[p] denotes full_extent_t; and
    • for k equal to rank_ - SubExtents​::​rank() - u, SliceSpecifiers...[k] is a unit-stride slice type;
    and where S_static is:
    • dynamic_extent, if static_extent(k) is dynamic_extent for any k in the range [rank_ - u - 1, rank_),
    • otherwise, the product of all values static_extent(k) for k in the range [rank_ - u - 1, rank_);
  • otherwise, submdspan_mapping_result{layout_stride::mapping(sub_ext, sub_strides), offset}