[mdspan.layout.leftpad.obs] (original) (raw)
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.8 Class template layout_left_padded::mapping [mdspan.layout.leftpad]
23.7.3.4.8.4 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;
Returns:
- 0 if the multidimensional index space extents_ is empty,
- otherwise, (*this)(extents_.extent(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 _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_.
Returns:
- 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;
Constraints:
- 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.
stride(1) is true.
Otherwise, false.