Espacios de nombres
Variantes
Acciones

std::get(std::array)

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

 
 
 
std::array
Las funciones miembro
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.
Elemento acceso
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.
Los iteradores
Original:
Iterators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Capacidad
Original:
Capacity
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Modificadores
Original:
Modifiers
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
Terceros funciones
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
Clases de ayuda
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.
 
template<size_t I, class T, size_t N >
T& get( array<T,N>& a );
(1) (desde C++11)
template<size_t I, class T, size_t N >
T&& get( array<T,N>&& a );
(2) (desde C++11)
template<size_t I, class T, size_t N >
const T& get( const array<T,N>& a );
(3) (desde C++11)
Extrae el elemento Ith elemento de la matriz .
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 debe ser un valor entero en [0, N) rango. Esto se aplica en tiempo de compilación en lugar de at() o 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.

Contenido

[editar] Parámetros

a -
matriz cuyo contenido desea extraer
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.

[editar] Valor de retorno

1)
Referencia al elemento Ith de 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 referencia al elemento de Ith a, a menos que el elemento sea de valor-i tipo de referencia, en cuyo caso se devuelve lvalue referencia .
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)
Const referencia al elemento 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.

[editar] Excepciones

noexcept specification:  
noexcept
  (desde C++11)

[editar] Ejemplo

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

Salida:

(1, 2, 3)

[editar] Ver también

acceder al elemento especificado
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.

(función miembro público) [editar]
acceder al elemento especificado con comprobación de límites
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.

(función miembro público) [editar]
accesos a tuplas elemento especificado
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.

(plantilla de función) [editar]
accede a un elemento de 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.

(plantilla de función) [editar]