[mdspan.layout.reqmts] (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.2 Requirements [mdspan.layout.reqmts]
A type M meets the layout mapping requirements if
- M models copyable and equality_comparable,
- is_nothrow_move_constructible_v<M> is true,
- is_nothrow_move_assignable_v<M> is true,
- is_nothrow_swappable_v<M> is true, and
- the following types and expressions are well-formed and have the specified semantics.
Result: A type that is a specialization of extents.
Result: typename M::extents_type::index_type.
Result: typename M::extents_type::rank_type.
Result: const typename M::extents_type&
Result: typename M::index_type
Returns: A nonnegative integer less than numeric_limits<typename M::index_type>::max() and less than or equal to numeric_limits<size_t>::max().
m(i...) == m(static_cast<typename M::index_type>(i)...)
Result: typename M::index_type
Returns: If the size of the multidimensional index space m.extents() is 0, then 0, else 1 plus the maximum value of m(i...) for all i.
Returns: true only if for every i and j where (i != j || ...) is true,m(i...) != m(j...) is true.
[Note 1:
A mapping can return false even if the condition is met.
For certain layouts, it is possibly not feasible to determine efficiently whether the layout is unique.
— _end note_]
Returns: true only if for all k in the range [0, m.required_span_size())there exists an i such that m(i...) equals k.
[Note 2:
A mapping can return false even if the condition is met.
For certain layouts, it is possibly not feasible to determine efficiently whether the layout is exhaustive.
— _end note_]
Returns: true only if for every rank index r of m.extents() there exists an integer such that, for all i where is a multidimensional index in m.extents() ([mdspan.overview]),m((i + )...) - m(i...) equals .
[Note 3:
This implies that for a strided layout.
— _end note_]
[Note 4:
A mapping can return false even if the condition is met.
For certain layouts, it is possibly not feasible to determine efficiently whether the layout is strided.
— _end note_]
Preconditions: m.is_strided() is true.
Result: typename M::index_type
Returns: as defined in m.is_strided() above.
[Note 5:
It is not required for m.stride(r) to be well-formed if m.extents().rank() is zero, even if m.is_always_strided() is true.
— _end note_]
Returns: true only if m.is_unique() is truefor all possible objects m of type M.
[Note 6:
A mapping can return false even if the above condition is met.
For certain layout mappings, it is possibly not feasible to determine whether every instance is unique.
— _end note_]
M::is_always_exhaustive()
Returns: true only if m.is_exhaustive() is truefor all possible objects m of type M.
[Note 7:
A mapping can return false even if the above condition is met.
For certain layout mappings, it is possibly not feasible to determine whether every instance is exhaustive.
— _end note_]
Returns: true only if m.is_strided() is truefor all possible objects m of type M.
[Note 8:
A mapping can return false even if the above condition is met.
For certain layout mappings, it is possibly not feasible to determine whether every instance is strided.
— _end note_]