(C++17) | ||||
| Sequence | ||||
(C++11) | ||||
(C++26) | ||||
(C++26) | ||||
(C++11) | ||||
| Associative | ||||
| Unordered associative | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
(C++11) | ||||
| Adaptors | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
(C++23) | ||||
| Views | ||||
(C++20) | ||||
(C++23) | ||||
| Tables | ||||
| Iterator invalidation | ||||
| Member function table | ||||
| Non-member function table |
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
constexpr mdspan(); | (1) | (since C++23) |
template<class...OtherIndexTypes> constexprexplicit mdspan( data_handle_type p, OtherIndexTypes...exts); | (2) | (since C++23) |
template<class OtherIndexType,std::size_t N> constexprexplicit(N!= rank_dynamic()) | (3) | (since C++23) |
template<class OtherIndexType,std::size_t N> constexprexplicit(N!= rank_dynamic()) | (4) | (since C++23) |
constexpr mdspan( data_handle_type p,const extents_type& ext); | (5) | (since C++23) |
constexpr mdspan( data_handle_type p,const mapping_type& m); | (6) | (since C++23) |
constexpr mdspan( data_handle_type p,const mapping_type& m, const accessor_type& a); | (7) | (since C++23) |
template<class OtherElementType,class OtherExtents, class OtherLayoutPolicy,class OtherAccessor> | (8) | (since C++23) |
constexpr mdspan(const mdspan& rhs)=default; | (9) | (since C++23) |
constexpr mdspan( mdspan&& rhs)=default; | (10) | (since C++23) |
Constructs anmdspan, optionally using user-supplied data handlep, layout mappingm, and accessora. If extentsexts orext are supplied, they are converted toextents_type and used to initialize the layout mapping.
Contents |
| p | - | a handle to the underlying data |
| m | - | a layout mapping |
| a | - | an accessor |
| ext | - | astd::extents object |
| exts | - | represents a multi-dimensional extents |
| other | - | another mdspan to convert from |
| rhs | - | another mdspan to copy or move from |
For the data members listed in the table below:
| Overload | Initializer for... | ||
|---|---|---|---|
ptr_ | map_ | acc_ | |
| (1) | (empty) | ||
| (2) | std::move(p) | extents_type (static_cast<index_type> (std::move(exts))...) | (empty) |
| (3) | extents_type(exts) | ||
| (4) | |||
| (5) | ext | ||
| (6) | m | ||
| (7) | a | ||
| (8) | other.ptr_ | other.map_ | other.acc_ |
[0, map_ .required_span_size()) is not anaccessible range ofptr_ andacc_ for the values ofmap_ andacc_ after the invocation of this constructor, the behavior is undefined.[0, map_ .required_span_size()) is not an accessible range ofp andacc_ for the values ofmap_ andacc_ after the invocation of these constructors, the behavior is undefined.[0, map_ .required_span_size()) is not an accessible range ofp andacc_ for the values ofmap_ andacc_ after the invocation of these constructors, the behavior is undefined.[0, map_ .required_span_size()) is not an accessible range ofp andacc_ for the values ofmap_ andacc_ after the invocation of these constructors, the behavior is undefined.[0, m.required_span_size()) is an accessible range ofp andacc_ for the value ofacc_ after the invocation of this constructor, the behavior is undefined.[0, m.required_span_size()) is not an accessible range ofp anda, the behavior is undefined.[0, map_ .required_span_size()) is not an accessible range ofptr_ andacc_ for the values ofptr_,map_ andacc_ after the invocation of this constructor, the behavior is undefined.Ifstatic_extent(r)==std::dynamic_extent | (until C++26) |
Ifstatic_extent(r)==std::dynamic_extent
| (since C++26) |
| This section is incomplete Reason: no example |
| This section is incomplete |