std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>:: operator[]
|
template
<
class
...
OtherIndexTypes
>
constexpr reference operator [ ] ( OtherIndexTypes... indices ) const ; |
(1) | (seit C++23) |
|
template
<
class
OtherIndexType
>
constexpr
reference operator
[
]
|
(2) | (seit C++23) |
|
template
<
class
OtherIndexType
>
constexpr
reference operator
[
]
|
(3) | (seit C++23) |
Gibt eine Referenz auf das indices te Element des mdspan zurück.
acc_
.
access
(
ptr_
,
map_
(
static_cast
<
index_type
>
(
std
::
move
(
indices
)
)
...
)
)
;
.
- ( std:: is_convertible_v < OtherIndexTypes, index_type > && ... )
- ( std:: is_nothrow_constructible_v < index_type, OtherIndexTypes > && ... )
- sizeof... ( OtherIndexTypes ) == rank ( )
|
Wenn
extents_type
::
|
(bis C++26) |
|
Wenn
extents_type
::
|
(seit C++26) |
P
ein Parameter-Pack, sodass
std::
is_same_v
<
std::
make_index_sequence
<
rank
(
)
>
,
std:: index_sequence < P... >> gleich true ist, äquivalent zu return operator [ ] ( extents_type ::
index-cast
(
std::
as_const
(
indices
[
P
]
)
)
...
)
;
.
- std:: is_convertible_v < const OtherIndexType & , index_type >
- std:: is_nothrow_constructible_v < index_type, const OtherIndexType & >
Inhaltsverzeichnis |
Parameter
| indices | - | die Indizes des Elements, auf das zugegriffen werden soll |
Rückgabewert
Eine Referenz auf das Element.
Beispiel
|
Dieser Abschnitt ist unvollständig
Grund: Kein Beispiel |
Fehlerberichte
Die folgenden verhaltensändernden Fehlerberichte wurden rückwirkend auf zuvor veröffentlichte C++-Standards angewendet.
| DR | Angewendet auf | Verhalten wie veröffentlicht | Korrektes Verhalten |
|---|---|---|---|
| LWG 3974 | C++23 |
Überladungen
(2,3)
wandten
extents_type::
index-cast
nicht an
|
wendet an |
Siehe auch
| Dieser Abschnitt ist unvollständig |