std::swap(std::weak_ptr)
来自cppreference.com
| 定义于头文件 <memory>
|
||
| template< class T > void swap( std::weak_ptr<T>& lhs, std::weak_ptr<T>& rhs ) noexcept; |
(C++11 起) | |
对 std::weak_ptr 特化 std::swap 算法。交换 lhs 与 rhs 的内容。调用 lhs.swap(rhs) 。
参数
| lhs, rhs | - | 要交换内容的智能指针 |
返回值
(无)
复杂度
常数
参阅
| 交换两个对象的值 (函数模板) | |
| 交换内容 (公开成员函数) |