std::unique_ptr:
1auto p1 = std::make_unique<int[]>(100);2auto p2 = std::move(p1); // p1 is now null
std::shared_ptr:
1auto p1 = std::make_shared<int>(42);2auto p2 = p1; // ref count = 23// Destroyed when last shared_ptr dies
Weak pointer: Breaks cycles in shared ownership:
1std::weak_ptr<Node> weak = shared;2if (auto locked = weak.lock()) { /* use */ }