从一 auto_ptr 对象所有权转移到另一个的赋值运算符。
template<class Other>
auto_ptr<Type>& operator=(
auto_ptr<Other>& _Right
) throw( );
auto_ptr<Type>& operator=(
auto_ptr<Type>& _Right
) throw( );
auto_ptr<Type>& operator=(
auto_ptr_ref<Type> _Right
) throw( );
参数
- _Right
auto_ptr 类型的对象。
返回值
对类型 auto_ptr<*** 类型 ***>对象的引用。
备注
由于该分配,因此,只有当单元的指针 myptr 更改的赋值计算表达式,delete myptr,但。然后调用_Right存储的指针的所有权,通过存储_Right。在 myptr的版本。函数返回 *this。
示例
有关使用的示例成员运算符,请参见 auto_ptr::auto_ptr。
要求
标头: <memory>
命名空间: std