Class Central is learner-supported. When you buy through links on our site, we may earn an affiliate commission.

YouTube

Weak Pointers in C++ - Understanding std::weak_ptr

The Cherno via YouTube

Overview

Explore the concept of weak pointers in C++ and their implementation using std::weak_ptr in this 17-minute tutorial. Learn how shared pointers work, understand the use of raw pointers as weak references, and delve into the specifics of weak pointers. Discover why cyclical dependencies require weak pointers and examine a practical code review example. Gain valuable insights into memory management and smart pointer usage in C++ programming.

Syllabus

- Intro
- How shared pointers work
- Raw pointers as weak references
- Weak pointers
- Cyclical dependencies need weak pointers
- Code Review example
- Conclusion

Taught by

The Cherno

Reviews

Start your review of Weak Pointers in C++ - Understanding std::weak_ptr

Never Stop Learning.

Get personalized course recommendations, track subjects and courses with reminders, and more.

Someone learning on their laptop while sitting on the floor.