std::shared_ptr<T> lets several owners share one object. It keeps a reference count: each copy adds one, each destroyed or reset copy takes one away, and the object is deleted when the count reaches zero. use_count() reports the count. Create one with std::make_shared<T>(args...), which allocates the object and its count together.
Shared ownership has one classic trap, a cycle. If a parent holds a shared_ptr to its child and the child holds a shared_ptr back to the parent, neither count can reach zero and both leak. The fix is std::weak_ptr<T>, a pointer that watches an object without owning it. It does not keep the object alive: call lock() to get a shared_ptr, which is empty if the object is already gone.
Use unique_ptr by default. Reach for shared_ptr when ownership really is shared, such as limits read by several strategies, and for weak_ptr in caches, observers and back-pointers.
Owners count; watchers do not.