[mdspan.extents.expo] (original) (raw)
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;
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 rsuch 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_]