std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>:: operator[]
|
template
<
class
...
OtherIndexTypes
>
constexpr reference operator [ ] ( OtherIndexTypes... indices ) const ; |
(1) | (desde C++23) |
|
template
<
class
OtherIndexType
>
constexpr
reference operator
[
]
|
(2) | (desde C++23) |
|
template
<
class
OtherIndexType
>
constexpr
reference operator
[
]
|
(3) | (desde C++23) |
Devuelve una referencia al indices th elemento del 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
::
|
(hasta C++26) |
|
Si
extents_type
::
|
(desde C++26) |
P
un paquete de parámetros tal que
std::
is_same_v
<
std::
make_index_sequence
<
rank
(
)
>
,
std:: index_sequence < P... >> sea true , equivalente a 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 & >
Contenidos |
Parámetros
| indices | - | los índices del elemento a acceder |
Valor de retorno
Una referencia al elemento.
Ejemplo
|
Esta sección está incompleta
Razón: sin ejemplo |
Informes de defectos
Los siguientes informes de defectos que modifican el comportamiento se aplicaron retroactivamente a los estándares de C++ publicados anteriormente.
| DR | Aplicado a | Comportamiento publicado | Comportamiento correcto |
|---|---|---|---|
| LWG 3974 | C++23 |
las sobrecargas
(2,3)
no aplicaban
extents_type::
index-cast
|
aplican |
Véase también
| Esta sección está incompleta |