std::forward_list<T,Allocator>::swap_C++中文网
| void swap( forward_list& other ); |
(C++11 起) (C++17 前) |
|
| void swap( forward_list& other ) noexcept(/* see below */); |
(C++17 起) | |
将内容与 other 的交换。不在单个元素上调用任何移动、复制或交换操作。
所有迭代器和引用保持合法。在操作后,保有此容器中尾后值的迭代器指代此容器或另一容器是未指定的。
|
若 std::allocator_traits<allocator_type>::propagate_on_container_swap::value 为 true ,则用非成员 |
(C++11 起) |
参数
| other | - | 要与之交换内容的容器 |
返回值
(无)
异常
|
(无) |
(C++17 前) |
| (C++17 起) |
复杂度
常数。
参阅
| (C++11) |
特化 std::swap 算法 (函数模板) |