* refactor: clean to roadmap content * refactor: move shared helpers into scripts/lib
533 B
533 B
weak_ptr
weak_ptr is a smart pointer in C++ that holds a non-owning reference to an object managed by a shared_ptr. It doesn't participate in the object's ownership count, meaning that it doesn't prevent the object from being destroyed if the shared_ptrs owning the object go out of scope. Its primary use is to detect if the object managed by the shared_ptr still exists. You can obtain a shared_ptr from a weak_ptr using lock(), but this might return an empty shared_ptr if the object has already been destroyed.