(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 |
|
| ||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
template<class...OtherIndexTypes> constexpr reference operator[]( OtherIndexTypes...indices)const; | (1) | (since C++23) |
template<class OtherIndexType> constexpr reference operator[] | (2) | (since C++23) |
template<class OtherIndexType> constexpr reference operator[] | (3) | (since C++23) |
Returns a reference to theindicesth element of the mdspan.
acc_ .access(ptr_, map_ (static_cast<index_type>(std::move(indices))...));.Ifextents_type:: | (until C++26) |
Ifextents_type::
| (since C++26) |
P be a parameter pack such thatstd::is_same_v<std::make_index_sequence<rank()>,index-cast (std::as_const(indices[P]))...);.Contents |
| indices | - | the indices of the element to access |
A reference to the element.
| This section is incomplete Reason: no example |
The following behavior-changing defect reports were applied retroactively to previously published C++ standards.
| DR | Applied to | Behavior as published | Correct behavior |
|---|---|---|---|
| LWG 3974 | C++23 | overloads(2,3) did not applyextents_type::index-cast | applies |
| This section is incomplete |