unique_ptr operator=

分配提供的 unique_ptr 的地址到当前一个。

unique_ptr& operator=(
    unique_ptr&& _Right
);
template<class Type2, Class Del2>
    unique_ptr& operator=(
        unique_ptr<Type, Del>&& _Right
    );
unique_ptr& operator=(
    pointer-type
);

参数

  • unique_ptr 引用用于分配给当前 unique_ptr的值。

备注

成员函数调用 reset(_Right.release()) 并将 _Right.stored_deleter 到 stored_deleter,然后返回 *this。

要求

**标题:**memory

命名空间: std

请参见

参考

unique_ptr Class

<memory>

线程安全性对标准C++库中

其他资源

unique_ptr 成员

memory 成员