Skip to content

Glossary: C++ Beyond the Basics

Weak pointer

Also written: std::weak_ptr, weak_ptr

`std::weak_ptr` watches a shared object without adding to its count. It breaks cycles of `shared_ptr`s, and `.lock()` gives a `shared_ptr`, empty if the object has gone.

Where the book teaches it

Related terms

Shared pointerReference count