Skip to content

Glossary: Coding Interviews in C++

std::unique_ptr

Also written: unique_ptr, std::make_unique

A smart pointer that owns the object it points to and frees it automatically. Tree nodes own their children this way, and a function that only looks takes a `const TreeNode*`.

Where the book teaches it

Related terms

Pointer