std::weak_ptr<T>::operator=
来自cppreference.com
                    
                                        
                    
                    
                                                            
                    |   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 亦不管理对象。
1-3) 等价于 std::weak_ptr<T>(r).swap(*this) 。
4,5) 等价于 std::weak_ptr<T>(std::move(r)).swap(*this) 。
参数
| r | - | 与之共享对象的智能指针 | 
返回值
*this
注意
实现应满足要求而不创建临时的 weak_ptr 对象。
参阅
  构造新的weak_ptr (公开成员函数)  | |
|   交换被管理对象  (公开成员函数)  |