std::swap(std::vector)_C++中文网
| template< class T, class Alloc > void swap( vector<T,Alloc>& lhs, |
(C++17 前) | |
| template< class T, class Alloc > void swap( vector<T,Alloc>& lhs, |
(C++17 起) | |
为 std::vector 特化 std::swap 算法。交换 lhs 与 rhs 的内容。调用 lhs.swap(rhs) 。
参数
| lhs, rhs | - | 要交换内容的容器 |
返回值
(无)
复杂度
常数。
异常
| (C++17 起) |
参阅
| 交换内容 (公开成员函数) |