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()) 移动到 stored_deleter,然后返回 *this_Right.stored_deleter。

要求

页眉: <内存>

命名空间: std

请参见

参考

unique_ptr 类

<memory>

C++ 标准库中的线程安全

其他资源

unique_ptr 成员

memory 成员