23 Containers library [containers]

23.7 Views [views]

23.7.3 Multidimensional access [views.multidim]

23.7.3.4 Layout mapping [mdspan.layout]

23.7.3.4.9 Class template layout_right_padded​::​mapping [mdspan.layout.rightpad]

23.7.3.4.9.4 Observers [mdspan.layout.rightpad.obs]

constexpr array<index_type, rank_> strides() const noexcept;
Returns: array<index_type, rank_>(stride(P_rank)...).
constexpr index_type required_span_size() const noexcept;
Returns: 0 if the multidimensional index space extents_ is empty, otherwise *this(((extents_(P_rank) - index_type(1))...)) + 1.
template<class... Indices> constexpr size_t operator()(Indices... idxs) const noexcept;
Constraints:
  • sizeof...(Indices) == rank_ is true.
  • (is_convertible_v<Indices, index_type> && ...) is true.
  • (is_nothrow_constructible_v<index_type, Indices> && ...) is true.
Preconditions: extents_type​::​index-cast(idxs) is a multidimensional index in extents() ([mdspan.overview]).
Returns: ((static_cast<index_type>(idxs) * stride(P_rank)) + ... + 0).
static constexpr bool is_always_exhaustive() noexcept;
Returns:
  • If rank_ equals zero or one, then true;
  • otherwise, if neither static-padding-stride nor last-static-extent equal dynamic_extent, then static-padding-stride == last-static-extent;
  • otherwise, false.
constexpr bool is_exhaustive() const noexcept;
Returns: true if rank_ equals zero or one; otherwise, extents_.extent(rank_ - 1) == stride(rank_ - 2)
constexpr index_type stride(rank_type r) const noexcept;
Preconditions: r is smaller than rank_.
Returns:
  • If r equals rank_ - 1: 1;
  • otherwise, if r equals rank_ - 2: stride-rm2;
  • otherwise, the product of stride-rm2 and all values extents_.extent(k) with k in the range of [r + 1, rank_ - 1).
template<class LayoutRightPaddedMapping> friend constexpr bool operator==(const mapping& x, const LayoutRightPaddedMapping& y) noexcept;
Constraints:
  • is-layout-right-padded-mapping-of<LayoutRightPaddedMapping> is true.
  • LayoutRightPaddedMapping​::​extents_type​::​rank() == rank_ is true.
Returns: true if x.extents() == y.extents() is true and rank_ < 2 || x.stride(rank_ - 2) == y.stride(rank_ - 2) is true.
Otherwise, false.