Namespaces
Variants

std::extents<IndexType,Extents...>:: index-cast

From cppreference.net
template < class OtherIndexType >
static constexpr auto /*index-cast*/ ( OtherIndexType && i ) noexcept ;
(depuis C++23)
( exposition uniquement* )

Convertit l'index i de type OtherIndexType en un certain type intégral.

C'est équivalent à :

  • return i ; , si OtherIndexType est un type intégral autre que bool et
  • return static_cast < index_type > ( i ) ; sinon.

Paramètres

i - l'indice à convertir

Valeur de retour

Index de cast.

Notes

Un appel à cette fonction retournera toujours un type intégral autre que bool . Les types de classe entière peuvent utiliser la branche static_cast sans perte de précision car les sites d'appel de cette fonction sont déjà contraints sur la convertibilité de OtherIndexType en index_type .