std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>:: operator[]
|
template
<
class
...
OtherIndexTypes
>
constexpr reference operator [ ] ( OtherIndexTypes... indices ) const ; |
(1) | (depuis C++23) |
|
template
<
class
OtherIndexType
>
constexpr
reference operator
[
]
|
(2) | (depuis C++23) |
|
template
<
class
OtherIndexType
>
constexpr
reference operator
[
]
|
(3) | (depuis C++23) |
Retourne une référence au indices ème élément du mdspan.
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 ( )
|
Si
extents_type
::
|
(jusqu'en C++26) |
|
Si
extents_type
::
|
(depuis C++26) |
P
un pack de paramètres tel que
std::
is_same_v
<
std::
make_index_sequence
<
rank
(
)
>
,
std:: index_sequence < P... >> soit true , équivalent à 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 & >
Table des matières |
Paramètres
| indices | - | les indices de l'élément à accéder |
Valeur de retour
Une référence à l'élément.
Exemple
|
Cette section est incomplète
Raison : aucun exemple |
Rapports de défauts
Les rapports de défauts modifiant le comportement suivants ont été appliqués rétroactivement aux normes C++ précédemment publiées.
| DR | Applicable à | Comportement publié | Comportement corrigé |
|---|---|---|---|
| LWG 3974 | C++23 |
les surcharges
(2,3)
n'appliquaient pas
extents_type::
index-cast
|
appliquent |
Voir aussi
| Cette section est incomplète |