Modern C++ Smart Pointers: unique_ptr and shared_ptr Use unique_ptr, shared_ptr, and weak_ptr to model ownership in modern C++ without manual new and delete or memory leaks. Jun 18, 2026 ·5 min read · #cpp#memory#intermediate