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.5 Class template layout_left​::​mapping [mdspan.layout.left]

24.7.3.4.5.2 Constructors [mdspan.layout.left.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 OtherExents> constexpr explicit(!is_convertible_v<OtherExtents, extents_type>) mapping(const layout_right::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 LayoutLeftPaddedMapping> constexpr explicit(!is_convertible_v<typename LayoutLeftPaddedMapping::extents_type, extents_type>) mapping(const LayoutLeftPaddedMapping&) noexcept;
Constraints:
  • is-layout-left-padded-mapping-of<LayoutLeftPaddedMapping> is true.
  • is_constructible_v<extents_type, typename LayoutLeftPaddedMapping​::​extents_type>
    is true.
Mandates: If
  • Extents​::​rank() is greater than one,
  • Extents​::​static_extent(0) does not equal dynamic_extent, and
  • LayoutLeftPaddedMapping​::​static-padding-stride does not equal dynamic_extent,
then Extents​::​static_extent(0) equals LayoutLeftPaddedMapping​::​static-padding-stride.
Preconditions:
  • If extents_type​::​rank() > 1 is true, then other.stride(1) equals other.extents(0).
  • other.required_span_size() is representable as a value of type index_type.
Effects: 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);
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().fwd-prod-of-extents(r), and
  • other.required_span_size() is representable as a value of type index_type ([basic.fundamental]).
Effects: Direct-non-list-initializes extents_ with other.extents().