std::get(std::pair)
Da cppreference.com.
![]() | Questa pagina è stata tradotta in modo automatico dalla versione in ineglese della wiki usando Google Translate. La traduzione potrebbe contenere errori e termini strani. Muovi il puntatore sopra al testo per vedere la versione originale. Puoi aiutarci a correggere gli gli errori. Per ulteriori istruzioni clicca qui. |
template< size_t N, class T1, class T2 > typename std::tuple_element<I, std::pair<T1,T2>>::type& | (1) | (dal C++11) |
template< size_t N, class T1, class T2 > consttypename std::tuple_element<I, std::pair<T1,T2>>::type& | (2) | (dal C++11) |
(3) | (dal C++11) | |
Estrae un elemento dalla coppia con tupla-come l'interfaccia.
Original:
Extracts a element from the pair using tuple-like interface.
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.
Indice |
[modifica]Parametri
p | - | coppia il cui contenuto da estrarre Original: pair 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-2)Restituisce
3) p.first
se N==0
e p.second
se N==1
.Original:
Returns
p.first
if N==0
and p.second
if N==1
.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.
Restituisce std::forward<T1&&>(p.first) se
N==0
e std::forward<T2&&>(p.second) se N==1
Original:
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.
[modifica]Eccezioni
1-3)[modifica]Esempio
#include <iostream>#include <utility> int main(){auto p =std::make_pair(1, 3.14);std::cout<<'('<< std::get<0>(p)<<", "<< std::get<1>(p)<<')'<<std::endl;}
Output:
(1, 3.14)
[modifica]Vedi anche
tupla accede elemento specificato 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. (funzione di modello) | |
accesses an element of an array (funzione di modello) |