std::unique_ptr
std::unique_ptr
Defined in header <memory> | ||
---|---|---|
template< class T, class Deleter = std::default_delete<T> > class unique_ptr; | (1) | (since C++11) |
template < class T, class Deleter > class unique_ptr<T[], Deleter>; | (2) | (since C++11) |
std::unique_ptr
is a smart pointer that owns and manages another object through a pointer and disposes of that object when the unique_ptr
goes out of sco