Smart Pointers: Weak Pointers

std::weak_ptr is the last component of the smart pointers family. Its purpose is limited compared to the other smart pointer, and we will examine why in this lesson.

We'll cover the following


To be honest, std::weak_ptr is not a classic smart pointer. std::weak_ptr supports no transparent access to the resource as it only borrows the resource from a std::shared_ptr.

Create a free account to view this lesson.

By signing up, you agree to Educative's Terms of Service and Privacy Policy