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 ; |
(desde C++23)
( solo para exposición* ) |
|
Convierte el índice
i
de tipo
OtherIndexType
a un tipo integral determinado.
Es equivalente a:
-
return
i
;
, si
OtherIndexTypees un tipo integral distinto de bool y - return static_cast < index_type > ( i ) ; en caso contrario.
Parámetros
| i | - | el índice a convertir |
Valor de retorno
Índice de conversión.
Notas
Una llamada a esta función siempre devolverá un tipo integral distinto de
bool
.
Los
tipos de clase entera
pueden utilizar la rama
static_cast
sin pérdida de precisión porque los sitios de llamada de esta función ya están restringidos en la convertibilidad de
OtherIndexType
a
index_type
.