std::tuple::swap
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. |
Elemento definito nell'header <tuple> | ||
void swap( tuple& other ); | (dal C++11) | |
Chiede std::swap per ogni elemento in *this e il suo elemento corrispondente in
other
.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.
Indice |
[modifica]Parametri
other | - | tupla di valori da scambiare Original: tuple of values to swap 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
(Nessuno)
Original:
(none)
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
noexcept specification: (dal C++11)
noexcept( noexcept(swap(std::declval<T0&>>(), std::declval<T0&>()))&& | ||
[modifica]Esempio
#include <iostream>#include <tuple>#include <string> int main(){std::tuple<int, std::string, float> p1, p2; p1 =std::make_tuple(10, "test", 3.14); p2.swap(p1);std::cout<<"("<< std::get<0>(p2)<<", "<< std::get<1>(p2)<<", "<< std::get<2>(p2)<<")\n";}
Output:
(10, test, 3.14)