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

Google, IBM & Meta Certificates – 40% Off
One Coursera Plus subscription covers most Professional Certificates on Coursera.
Unlock All Certificates
This short tutorial explains how std::weak_ptr works with shared pointers and raw pointers, including how weak pointers can handle cyclical dependencies. It concludes with a code review example.

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.