24 Containers library [containers]

24.7 Views [views]

24.7.3 Multidimensional access [views.multidim]

24.7.3.3 Class template extents [mdspan.extents]

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

static constexpr rank_type dynamic-index(rank_type i) noexcept;
Preconditions: i <= rank() is true.
Returns: The number of with for which is a dynamic extent.
static constexpr rank_type dynamic-index-inv(rank_type i) noexcept;
Preconditions: i < rank_dynamic() is true.
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;
Preconditions: i <= rank() is true.
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;
Preconditions: i < rank() is true.
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;
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]