std::pair::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. |
void swap(pair& other); | (dal C++11) | |
Swap
first
con other.first
e second
con other.second
.Original:
Swaps
first
with other.first
and second
with other.second
.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 | - | coppia di valori da scambiare Original: pair 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)
[modifica]Esempio
#include <iostream>#include <utility>#include <string>int main(){std::pair<int, std::string> p1, p2; p1 =std::make_pair(10, "test"); p2.swap(p1);std::cout<<"("<< p2.first<<", "<< p2.second<<")\n";}
Output:
(10, test)