std::extents<IndexType,Extents...>:: index-cast
From ja.cppreference.net
|
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
以外の整数型を返します。
Integer-class types
は、この関数の呼び出し元が既に
OtherIndexType
から
index_type
への変換可能性を制約しているため、精度を損なうことなく
static_cast
分岐を使用できます。