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 ; |
(seit C++23)
( nur zur Darstellung* ) |
|
Wandelt den Index
i
vom Typ
OtherIndexType
in einen bestimmten Integraltyp um.
Es ist äquivalent zu:
-
return
i
;
, falls
OtherIndexTypeein integraler Typ außer bool ist und - return static_cast < index_type > ( i ) ; andernfalls.
Parameter
| i | - | der zu konvertierende Index |
Rückgabewert
Cast-Index.
Hinweise
Ein Aufruf dieser Funktion gibt immer einen ganzzahligen Typ zurück, der nicht
bool
ist.
Integer-class types
können den
static_cast
Zweig ohne Genauigkeitsverlust verwenden, da die Aufrufstellen dieser Funktion bereits auf die Konvertierbarkeit von
OtherIndexType
zu
index_type
eingeschränkt sind.