std::get(std::tuple)

Da cppreference.com.
< cpp‎ | utility‎ | tuple

 
 
Utilità libreria
Tipo di supporto (basic types, RTTI, type traits)
Gestione della memoria dinamica
La gestione degli errori
Programma di utilità
Funzioni variadic
Data e ora
Funzione oggetti
initializer_list(C++11)
bitset
hash(C++11)
Gli operatori relazionali
Original:
Relational operators
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
rel_ops::operator!=
rel_ops::operator>
rel_ops::operator<=
rel_ops::operator>=
Coppie e tuple
Original:
Pairs and tuples
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
pair
tuple(C++11)
piecewise_construct_t(C++11)
piecewise_construct(C++11)
Swap, in avanti e spostare
Original:
Swap, forward and move
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
swap
forward(C++11)
move(C++11)
move_if_noexcept(C++11)
declval(C++11)
 
std::tuple
Membri funzioni
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.
tuple::tuple
tuple::operator=
tuple::swap
Non membri funzioni
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.
make_tuple
tie
forward_as_tuple
None
operator=
operator!=
operator<
operator<=
operator>
operator>=
std::swap
get
Helper classi
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
uses_allocator
ignore
 
template<std::size_t I, class... Types>

typename std::tuple_element<I, tuple<Types...>>::type&

    get( tuple<Types...>& t );
(1) (dal C++11)
template<std::size_t I, class... Types>

typename std::tuple_element<I, tuple<Types...>>::type&&

    get( tuple<Types...>&& t );
(2) (dal C++11)
template<std::size_t I, class... Types>

typename std::tuple_element<I, tuple<Types...>>::typeconst&

    get(const tuple<Types...>& t );
(3) (dal C++11)
Estrae l'elemento Ith elemento della tupla. I è un valore intero in [0, sizeof...(Types)).
Original:
Extracts the Ith element element from the tuple. I is an integer value in [0, sizeof...(Types)).
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

Indice

[modifica]Parametri

t -
tupla il cui contenuto da estrarre
Original:
tuple 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.

[modifica]Valore di ritorno

1)
Riferimento all'elemento Ith di t.
Original:
Reference to the Ith element of t.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.
2)
Rvalue riferimento all'elemento di Itht, a meno che l'elemento è di tipo lvalue riferimento, nel qual caso viene restituito lvalue riferimento.
Original:
Rvalue reference to the Ith element of t, 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 riferimento all'elemento Ith di t.
Original:
Const reference to the Ith element of t.
The text has been machine-translated via Google Translate.
You can help to correct and verify the translation. Click here for instructions.

[modifica]Eccezioni

noexcept specification:  
noexcept
  (dal C++11)

[modifica]Esempio

#include <iostream>#include <string>#include <tuple>   int main(){auto t =std::make_tuple(1, "Foo", 3.14);std::cout<<"("<< std::get<0>(t)<<", "<< std::get<1>(t)<<", "<< std::get<2>(t)<<")\n";}

Output:

(1, Foo, 3.14)

[modifica]Vedi anche

accesses an element of an array
(funzione di modello)[modifica]
accede a un elemento di una 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.

(funzione di modello)[modifica]
close