24 Containers library [containers]

24.7 Views [views]

24.7.3 Multidimensional access [views.multidim] Layout mapping [mdspan.layout] Class template layout_left_padded​::​mapping [mdspan.layout.leftpad] Observers [mdspan.layout.leftpad.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;
  • 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;
  • 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;
  • If rank_ equals zero or one, then true;
  • otherwise, if neither static-padding-stride nor first-static-extent equal dynamic_extent, then static-padding-stride == first-static-extent;
  • otherwise, false.
constexpr bool is_exhaustive() const noexcept;
Returns: true if rank_ equals zero or one; otherwise, extents_.extent(0) == stride(1).
constexpr index_type stride(rank_type r) const noexcept;
Preconditions: r is smaller than rank_.
  • If r equals zero: 1;
  • otherwise, if r equals one: stride-1;
  • otherwise, the product of stride-1 and all values extents_.extent(k) with k in the range [1, r).
template<class LayoutLeftPaddedMapping> friend constexpr bool operator==(const mapping& x, const LayoutLeftPaddedMapping& y) noexcept;
  • is-layout-left-padded-mapping-of<LayoutLeftPaddedMapping> is true.
  • LayoutLeftPaddedMapping​::​extents_type​::​rank() == rank_ is true.
Returns: true if x.extents() == y.extents() is true and rank_ < 2 || x.stride(1) == y.
is true.
Otherwise, false.