Espaces de noms
Variantes
Affichages
Actions

std::get(std::array)

De cppreference.com
< cpp‎ | container‎ | array

 
 
 
std::array
Les fonctions membres
Original:
Member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Elément d'accès
Original:
Element access
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::at
array::operator[]
array::front
array::back
array::data
Les itérateurs
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::begin
array::cbegin
array::end
array::cend
array::rbegin
array::crbegin
array::rend
array::crend
Capacité
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::empty
array::size
array::max_size
Modificateurs
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
array::fill
array::swap
Tiers fonctions
Original:
Non-member functions
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
get
swap
Classes d'aide
Original:
Helper classes
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
tuple_size
tuple_element
 
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.
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.

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 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.
2)
Rvalue référence à l'élément de 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.
3)
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.

[modifier] Exceptions

noexcept specification:  
noexcept
   (depuis C++11)

[modifier] Exemple

#include <iostream>
#include <array>
 
int main()
{
    std::array<int, 3> arr;
 
    // set values:
    std::get<0>(arr) = 1;
    std::get<1>(arr) = 2;
    std::get<2>(arr) = 3;
 
    // get values:
    std::cout << "(" << std::get<0>(arr) << ", " << std::get<1>(arr)
              << ", " << std::get<2>(arr) << ")\n";
}

Résultat :

(1, 2, 3)

[modifier] Voir aussi

accéder à l'élément spécifié
Original:
access 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 membre publique) [edit]
accéder à l'élément spécifié avec des limites de contrôle
Original:
access specified element with bounds checking
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

(fonction membre publique) [edit]
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) [edit]
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) [edit]