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.6 Class template layout_right​::​mapping [mdspan.layout.right]

23.7.3.4.6.2 Constructors [mdspan.layout.right.cons]

constexpr mapping(const extents_type& e) noexcept;
Preconditions: The size of the multidimensional index space e is representable as a value of type index_type ([basic.fundamental]).
Effects: Direct-non-list-initializes extents_ with e.
template<class OtherExtents> constexpr explicit(!is_convertible_v<OtherExtents, extents_type>) mapping(const mapping<OtherExtents>& other) noexcept;
Constraints: is_constructible_v<extents_type, OtherExtents> is true.
Preconditions: other.required_span_size() is representable as a value of type index_type ([basic.fundamental]).
Effects: Direct-non-list-initializes extents_ with other.extents().
template<class OtherExtents> constexpr explicit(!is_convertible_v<OtherExtents, extents_type>) mapping(const layout_left::mapping<OtherExtents>& other) noexcept;
Constraints:
  • extents_type​::​rank() <= 1 is true, and
  • is_constructible_v<extents_type, OtherExtents> is true.
Preconditions: other.required_span_size() is representable as a value of type index_type ([basic.fundamental]).
Effects: Direct-non-list-initializes extents_ with other.extents().
template<class LayoutRightPaddedMapping> constexpr explicit(!is_convertible_v<typename LayoutRightPaddedMapping::extents_type, extents_type>) mapping(const LayoutRightPaddedMapping&) noexcept;
Constraints:
  • is-layout-right-padded-mapping-of<LayoutRightPaddedMapping> is true.
  • is_constructible_v<extents_type, typename LayoutRightPaddedMapping​::​extents_-
    type>
    is true.
Mandates: If
  • Extents​::​rank() is greater than one,
  • Extents​::​static_extent(Extents​::​rank() - 1) does not equal dynamic_extent, and
  • LayoutRightPaddedMapping​::​static-padding-stride does not equal dynamic_extent,
then Extents​::​static_extent(Extents​::​rank() - 1) equals LayoutRightPaddedMapping​::​static-padding-stride.
Preconditions:
  • If extents_type​::​rank() > 1 is true, then other.stride(extents_type​::​rank() - 2)
    equals other.extents().extent(extents_type​::​rank() - 1).
  • other.required_span_size() is representable as a value of type index_type.
Effects: Direct-non-list-initializes extents_ with other.extents().
template<class OtherExtents> constexpr explicit(extents_type::rank() > 0) mapping(const layout_stride::mapping<OtherExtents>& other) noexcept;
Constraints: is_constructible_v<extents_type, OtherExtents> is true.
Preconditions:
  • If extents_type​::​rank() > 0 is true, then for all r in the range [0, extents_type​::​rank()), other.stride(r) equals other.extents().rev-prod-of-extents(r).
  • other.required_span_size() is representable as a value of type index_type ([basic.fundamental]).
Effects: Direct-non-list-initializes extents_ with other.extents().