std::unique_ptr::reset

From Cppreference

Jump to: navigation, search
void reset( pointer ptr = pointer() );
(C++11 feature)

Replaces the managed object. If *this manages an object, it is deleted, unless p is a pointer to it.

Contents

[edit] Parameters

ptr - pointer to a new object to manage

[edit] Return value

(none)

[edit] Example

[edit] See also

release
returns a pointer to the managed object and releases the ownership
(public member function)