`std::weak_ptr` provides non-owning access to an object managed by `std::shared_ptr`, crucially preventing memory leaks caused by circular references where two or more `shared_ptr` objects mutually own each other.
Open the full topic