Smart pointers — automatic memory management.
1#include <memory>23auto uptr = std::make_unique<int>(10);4auto sptr = std::make_shared<int>(20);5std::weak_ptr<int> wptr = sptr;
unique_ptr — exclusive.shared_ptr — shared.weak_ptr — non-owning.