在线文档教程
C++
容器 | Containers

std::unordered_multiset::swap

STD:无序[医]Multiset::SWAP

void swap( unordered_multiset& other (since C++11) (until C++17)
void swap( unordered_multiset& other ) noexcept(/* see below */(since C++17)

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

所有迭代器和引用仍然有效。过去的迭代器无效.

HashKeyEqual对象必须是Swappable,并且使用对非会员的非限定调用进行交换。swap...

If std::allocator_traits::propagate_on_container_swap::value is true, then the allocators are exchanged using an unqualified call to non-member swap. Otherwise, they are not swapped (and if get_allocator() != other.get_allocator(), the behavior is undefined).(since C++11)

参数

other-container to exchange the contents with

返回值

%280%29

例外

Any exception thrown by the swap of the Hash or KeyEqual objects.(until C++17)
noexcept specification: noexcept(std::allocator_traits<Allocator>::is_always_equal::value && std::is_nothrow_swappable<Hash>::value. && std::is_nothrow_swappable<KeyEqual>::value)(since C++17)

复杂性

常量。

另见

std::swap(std::unordered_multiset) (C++11)specializes the std::swap algorithm (function template)

© cppreference.com

在CreativeCommonsAttribution下授权-ShareAlike未移植许可v3.0。

http://en.cppreference.com/w/cpp/container/unorder[医]多集/交换