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

3.1 KiB

[mdspan.extents.expo]

23 Containers library [containers]

23.7 Views [views]

23.7.3 Multidimensional access [views.multidim]

23.7.3.3 Class template extents [mdspan.extents]

23.7.3.3.2 Exposition-only helpers [mdspan.extents.expo]

🔗

static constexpr rank_type dynamic-index(rank_type i) noexcept;

1

#

Preconditions: i <= rank() is true.

2

#

Returns: The number of Er with r<i for which Er is a dynamic extent.

🔗

static constexpr rank_type dynamic-index-inv(rank_type i) noexcept;

3

#

Preconditions: i < rank_dynamic() is true.

4

#

Returns: The minimum value of r such that dynamic-index(r + 1) == i + 1 is true.

🔗

constexpr size_t fwd-prod-of-extents(rank_type i) const noexcept;

5

#

Preconditions: i <= rank() is true.

6

#

Returns: If i > 0 is true, the product of extent(k) for all k in the range [0, i), otherwise 1.

🔗

constexpr size_t rev-prod-of-extents(rank_type i) const noexcept;

7

#

Preconditions: i < rank() is true.

8

#

Returns: If i + 1 < rank() is true, the product of extent(k) for all k in the range [i + 1, rank()), otherwise 1.

🔗

template<class OtherIndexType> static constexpr auto index-cast(OtherIndexType&& i) noexcept;

9

#

Effects:

If OtherIndexType is an integral type other than bool, then equivalent to return i;,

otherwise, equivalent to return static_cast<index_type>(i);.

[Note 1:

This function will always return an integral type other than bool.

Since this function's call sites are constrained on convertibility of OtherIndexType to index_type, integer-class types can use the static_cast branch without loss of precision.

— end note]