1 Matching Annotations
- Apr 2022
-
www.learncpp.com www.learncpp.com
-
std::shared_ptr can be used when you need multiple smart pointers that can co-own a resource. The resource will be deallocated when the last std::shared_ptr goes out of scope. std::weak_ptr can be used when you want a smart pointer that can see and use a shared resource, but does not participate in the ownership of that resource.
weak_ptr 的适用场景
-