Files
2025-10-25 03:02:53 +03:00

3.9 KiB
Raw Permalink Blame History

[mdspan.layout.stride.obs]

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.7 Class template layout_stride::mapping [mdspan.layout.stride]

23.7.3.4.7.4 Observers [mdspan.layout.stride.obs]

🔗

constexpr index_type required_span_size() const noexcept;

1

#

Returns: REQUIRED-SPAN-SIZE(extents(), strides_).

🔗

template<class... Indices> constexpr index_type operator()(Indices... i) const noexcept;

2

#

Constraints:

sizeof...(Indices) == rank_ is true,

(is_convertible_v<Indices, index_type> && ...) is true, and

(is_nothrow_constructible_v<index_type, Indices> && ...) is true.

3

#

Preconditions: extents_type::index-cast(i) is a multidimensional index in extents_ ([mdspan.overview]).

4

#

Effects: Let P be a parameter pack such thatis_same_v<index_sequence_for<Indices...>, index_sequence<P...>> is true.

Equivalent to:return ((static_cast<index_type>(i) * stride(P)) + ... + 0);

🔗

constexpr bool is_exhaustive() const noexcept;

5

#

Returns:

  • (5.1)

    true if rank_ is 0.

  • (5.2)

    Otherwise, true if there is a permutation P of the integers in the range [0, rank_) such that stride(p0) equals 1, andstride(pi) equals stride(pi−1) * extents().extent(pi−1) for i in the range [1, rank_), where pi is the ith element of P.

  • (5.3)

    Otherwise, false.

🔗

template<class OtherMapping> friend constexpr bool operator==(const mapping& x, const OtherMapping& y) noexcept;

6

#

Constraints:

7

#

Preconditions: OtherMapping meets the layout mapping requirements ([mdspan.layout.policy.reqmts]).

8

#

Returns: true if x.extents() == y.extents() is true,OFFSET(y) == 0 is true, and each of x.stride(r) == y.stride(r) is true for r in the range [0, x.extents().rank()).

Otherwise, false.