Unique_ptr in C++

A unique_ptr is like a normal pointer, except the fact that it "owns" the object to which it points, as mentioned above. The word "unique" in the title refers to the fact that at a time, only one unique_ptr can point to a given object. The object to which it points, is destroyed when the pointer itself is destroyed.

Read this article to understand Unique_ptr in C++ in depth

Have a doubt or thought? Join the discussion now

This is a companion discussion topic for the original entry at http://iq.opengenus.org/unique_ptr_cpp/