std::extents<IndexType,Extents...>:: index-cast
From cppreference.net
C++
Containers library
|
(C++17)
|
||||
| Sequence | ||||
|
(C++11)
|
||||
|
(C++26)
|
||||
|
(C++26)
|
||||
|
(C++11)
|
||||
| Associative | ||||
| Unordered associative | ||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
|
(C++11)
|
||||
| Adaptors | ||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
|
(C++23)
|
||||
| Views | ||||
|
(C++20)
|
||||
|
(C++23)
|
||||
| Tables | ||||
| Iterator invalidation | ||||
| Member function table | ||||
| Non-member function table |
std::mdspan
|
||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||||
std::extents
| Member functions | ||||
| Observers | ||||
| Helpers | ||||
|
extents::
index-cast
|
||||
| Non-member functions | ||||
| Deduction guides |
|
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
分岐を使用できます。