24 Containers library [containers]

24.7 Views [views]

24.7.3 Multidimensional access [views.multidim]

24.7.3.4 Layout mapping [mdspan.layout]

24.7.3.4.1 General [mdspan.layout.general]

  • M denotes a layout mapping class.
  • m denotes a (possibly const) value of type M.
  • i and j are packs of (possibly const) integers that are multidimensional indices in m.extents() ([mdspan.overview]).
    [Note 1: 
    The type of each element of the packs can be a different integer type.
    — end note]
  • r is a (possibly const) rank index of typename M​::​extents_type.
  • is a pack of (possibly const) integers for which sizeof...() == M​::​extents_type​::​rank() is true, the element is equal to 1, and all other elements are equal to 0.
In [mdspan.layout.reqmts] through [mdspan.layout.stride]:
  • Let is-mapping-of be the exposition-only variable template defined as follows: template<class Layout, class Mapping> constexpr bool is-mapping-of = // exposition only is_same_v<typename Layout::template mapping<typename Mapping::extents_type>, Mapping>;
  • Let is-layout-left-padded-mapping-of be the exposition-only variable template defined as follows: template<class Mapping> constexpr bool is-layout-left-padded-mapping-of = see below; // exposition only where is-layout-left-padded-mapping-of<Mapping> is true if and only if Mapping denotes a specialization of layout_left_padded<S>​::​mapping for some value S of type size_t.
  • Let is-layout-right-padded-mapping-of be the exposition-only variable template defined as follows: template<class Mapping> constexpr bool is-layout-right-padded-mapping-of = see below; // exposition only where is-layout-right-padded-mapping-of<Mapping> is true if and only if Mapping denotes a specialization of layout_right_padded<S>​::​mapping for some value S of type size_t.
  • For nonnegative integers x and y, let denote
    • y if x is zero,
    • otherwise, the least multiple of x that is greater than or equal to y.