shared_ptr
A `shared_ptr` is a smart pointer in C++ that manages the lifetime of an object through reference counting. When multiple `shared_ptr` instances point to the same object, they keep track of how many pointers are referencing that object. When the last `shared_ptr` pointing to the object is destroyed or reset, the object is automatically deleted, preventing memory leaks.
Using `shared_ptr` simplifies memory management by automatically handling the allocation and deallocation of resources. It is part of the C++ Standard Library and is defined in the `memory` header. This makes it easier for developers to write safer and more efficient code.