Skip to content

Glossary: Data Structures and Algorithms in C++

std::unique_ptr

Also written: unique_ptr, std::make_unique, make_unique

A smart pointer that owns the thing it points to and deletes it when it goes away. A unique_ptr can't be copied, only moved with std::move.

Where the book teaches it

Related terms

Ownershipnullptrstd::move