std::unique_ptr<T,Deleter>::release (3) - Linux Manuals
std::unique_ptr<T,Deleter>::release: std::unique_ptr<T,Deleter>::release
NAME
std::unique_ptr<T,Deleter>::release - std::unique_ptr<T,Deleter>::release
Synopsis
pointer release() noexcept; (since C++11)
Releases the ownership of the managed object if any. get() returns nullptr after the call.
Parameters
(none)
Return value
Pointer to the managed object or nullptr if there was no managed object, i.e. the value which would be returned by get() before the call.
Example
// Run this code
Output:
See also
get (public member function)
reset (public member function)