24 Containers library [containers]

24.7 Views [views]

24.7.3 Multidimensional access [views.multidim] Layout mapping [mdspan.layout] Class template layout_right​::​mapping [mdspan.layout.right] Observers [mdspan.layout.right.obs]

index_type required_span_size() const noexcept;
Returns: extents().fwd-prod-of-extents(extents_type​::​rank()).
template<class... Indices> constexpr index_type operator()(Indices... i) const noexcept;
  • sizeof...(Indices) == extents_type​::​rank() is true,
  • (is_convertible_v<Indices, index_type> && ...) is true, and
  • (is_nothrow_constructible_v<index_type, Indices> && ...) is true.
Preconditions: extents_type​::​index-cast(i) is a multidimensional index in extents_ ([mdspan.overview]).
Effects: Let P be a parameter pack such that is_same_v<index_sequence_for<Indices...>, index_sequence<P...>> is true.
Equivalent to: return ((static_cast<index_type>(i) * stride(P)) + ... + 0);
constexpr index_type stride(rank_type i) const noexcept;
Constraints: extents_type​::​rank() > 0 is true.
Preconditions: i < extents_type​::​rank() is true.
Returns: extents().rev-prod-of-extents(i).
template<class OtherExtents> friend constexpr bool operator==(const mapping& x, const mapping<OtherExtents>& y) noexcept;
Constraints: extents_type​::​rank() == OtherExtents​::​rank() is true.
Effects: Equivalent to: return x.extents() == y.extents();