weak_ptr& operator=( const weak_ptr& r ) noexcept;
|
(1) | (C++11 起) |
template< class Y >
weak_ptr& operator=( const weak_ptr<Y>& r ) noexcept; |
(2) | (C++11 起) |
template< class Y >
weak_ptr& operator=( const shared_ptr<Y>& r ) noexcept; |
(3) | (C++11 起) |
weak_ptr& operator=( weak_ptr&& r ) noexcept;
|
(4) | (C++14 起) |
template< class Y >
weak_ptr& operator=( weak_ptr<Y>&& r ) noexcept; |
(5) | (C++14 起) |
以 r
所管理者替换被管理对象。与 r
共享该对象。若 r
不管理对象,则 *this 亦不管理对象。
目录 |
r | - | 与之共享对象的智能指针 |
*this
实现应满足要求而不创建临时的 weak_ptr
对象。
构造新的weak_ptr (公开成员函数) |
|
交换被管理对象 (公开成员函数) |