<metanoindex/>
<tbody> </tbody> void swap(pair& other); |
(seit C++11) | |
Swaps
first mit other.first und second mit 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.
Parameter
| other | - | Wertepaar zu tauschen
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. |
Rückgabewert
(None)
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.
Ausnahmen
noexcept specification: (seit C++11)
<tbody>
</tbody>
noexcept( noexcept(std::swap(first, p.first)) && noexcept(std::swap(second, p.second)) ) |
||
Beispiel
#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)