Jump to content

C++ Language/Indirection/SmartPointers/UniqueOwnership

From Wikibooks, open books for an open world

If a smart pointer's memory should be "owned" by exactly one client, use std::unique_ptr<> for the smart pointer type.

Additional information about unique_ptr (includes interactive examples)