std::get(std::array)
De cppreference.com
![]() | This page has been machine-translated from the English version of the wiki using Google Translate. The translation may contain errors and awkward wording. Hover over text to see the original version. You can help to fix errors and improve the translation. For instructions click here. |
template<size_t I, class T, size_t N > T& get( array<T,N>& a ); | (1) | (depuis C++11) |
template<size_t I, class T, size_t N > T&& get( array<T,N>&& a ); | (2) | (depuis C++11) |
template<size_t I, class T, size_t N > const T& get(const array<T,N>& a ); | (3) | (depuis C++11) |
Extraits de l'élément element
Ith
à partir du tableau . Original:
Extracts the
Ith
element element from the array. The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
I
doit être une valeur entière dans [0, N)
gamme. Ceci est renforcé lors de la compilation plutôt que at()
ou operator[]()
.Original:
I
must be an integer value in range [0, N)
. This is enforced at compile time as opposed to at()
or operator[]()
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Sommaire |
[modifier]Paramètres
a | - | tableau dont le contenu à extraire Original: array whose contents to extract The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. |
[modifier]Retourne la valeur
1)Référence à l'élément de
2) Ith
a
.Original:
Reference to the
Ith
element of a
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Rvalue référence à l'élément de
3) Ith
a
, sauf si l'élément est de type référence lvalue, auquel cas lvalue référence est renvoyé .Original:
Rvalue reference to the
Ith
element of a
, unless the element is of lvalue reference type, in which case lvalue reference is returned.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
Référence const à l'élément de
Ith
a
.Original:
Const reference to the
Ith
element of a
.The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
You can help to correct and verify the translation. Click here for instructions.
[modifier]Exceptions
[modifier]Exemple
Résultat :
(1, 2, 3)
[modifier]Voir aussi
accède à l'élément spécifié (fonction membre publique) | |
accède à l'élément spécifié avec vérification de bornes (fonction membre publique) | |
tuple accède élément spécifié Original: tuple accesses specified element The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) | |
(C++11) | accède à un élément d'un pair Original: accesses an element of a pair The text has been machine-translated via Google Translate. You can help to correct and verify the translation. Click here for instructions. (fonction générique) |