Share via


unique_ptr operator=

Assigns the address of the provided unique_ptr to the current one.

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

Parameters

  • A unique_ptr reference used to assign the value of to the current unique_ptr.

Remarks

The member functions call reset(_Right.release()) and move _Right.stored_deleter to stored_deleter, then return *this.

Requirements

Header: <memory>

Namespace: std

See Also

Reference

unique_ptr Class

<memory>

Thread Safety in the C++ Standard Library