std::unordered_set<Key,Hash,KeyEqual,Allocator>::swap

来自cppreference.com
 
 
 
 
void swap( unordered_set& other );
(C++11 起)
(C++17 前)
void swap( unordered_set& other ) noexcept(/* 见下文 */);
(C++17 起)

将内容与 other 的交换。不在单独的元素上调用任何移动、复制或交换操作。

所有迭代器和引用仍然有效。