std::mdspan<T,Extents,LayoutPolicy,AccessorPolicy>:: operator[]
|
template
<
class
...
OtherIndexTypes
>
constexpr reference operator [ ] ( OtherIndexTypes... indices ) const ; |
(1) | (C++23以降) |
|
template
<
class
OtherIndexType
>
constexpr
reference operator
[
]
|
(2) | (C++23以降) |
|
template
<
class
OtherIndexType
>
constexpr
reference operator
[
]
|
(3) | (C++23以降) |
mdspanの indices th 要素への参照を返します。
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 ( )
|
|
(C++26まで) |
|
|
(C++26以降) |
P
を、
std::
is_same_v
<
std::
make_index_sequence
<
rank
(
)
>
,
std:: index_sequence < P... >> が true となるパラメータパックとする。これは 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 & >
目次 |
パラメータ
| indices | - | アクセスする要素のインデックス |
戻り値
要素への参照。
例
|
このセクションは不完全です
理由: 例がありません |
不具合報告
以下の動作変更の欠陥報告書は、以前に公開されたC++規格に対して遡及的に適用されました。
| DR | 適用対象 | 公開時の動作 | 正しい動作 |
|---|---|---|---|
| LWG 3974 | C++23 |
オーバーロード
(2,3)
は
extents_type::
index-cast
を適用しなかった
|
適用する |
関連項目
| このセクションは不完全です |