std::extents<IndexType,Extents...>::index-cast
From cppreference.com
| template< class OtherIndexType > static constexpr auto /*index-cast*/( OtherIndexType&& i ) noexcept; |
(C++23から) (説明用*) |
|
インデックスiを特定の整数型にキャストします。OtherIndexTypeはキャストされる型です。
これは以下と同等です。
- return i;、ただし
OtherIndexTypeがbool以外の整数型である場合。 - return static_cast<index_type>(i);、それ以外の場合。
[編集] パラメータ
| i | - | キャストするインデックス。 |
[編集] 戻り値
キャストされたインデックス。
[編集] 注記
この関数は常にbool以外の整数型を返します。整数クラス型は、この関数の呼び出しサイトがすでにOtherIndexTypeのindex_typeへの変換可能性に制約されているため、精度を失うことなくstatic_castブランチを使用できます。