[ Web Proxy ]
URL:
Viewing: https://fr.cppreference.com/cpp/container/array/get [Back]  [Original]

std::get(std::array) cppreference.com
cppreference.com
Espaces de noms
Variantes

std::get(std::array)

De cppreference.com

<metanoindex/>

 
 
 
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.
Elment d'accs
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 itrateurs
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
 
<tbody> </tbody>
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'lment 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 entire dans [0, N) gamme. Ceci est renforc lors de la compilation plutt 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.

Paramtres

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.

Retourne la valeur

1)

Rfrence l'lment 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 rfrence l'lment de Ith a, sauf si l'lment est de type rfrence lvalue, auquel cas lvalue rfrence 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)

Rfrence const l'lment 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.

Exceptions

noexcept specification:  
<tbody> </tbody>
noexcept
   (depuis C++11)

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";
}

Rsultat :

(1, 2, 3)

Voir aussi

accde l'lment spcifi
(fonction membre publique) [edit]
accde l'lment spcifi avec vrification de bornes
(fonction membre publique) [edit]
tuple accde lment spcifi
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 gnrique) [edit]
accde un lment 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 gnrique) [edit]

Web Proxy Viewer  |  New URL  |  Original Page