⚡ Build the skills to land top-paying quant jobs. Offer ends in 23d 14h 03m 11s23 days 14 hours 3 minutes 11 seconds.
⚡ Build the skills to land top-paying quant jobs. Offer ends in 23d 14h 03m 11s23 days 14 hours 3 minutes 11 seconds.

Sign in to watch this lesson
Ownership Types, Views and Type Erasure · 3:45
A std::weak_ptr watches an object without owning it, using the control block's weak count. We use lock() to get a real owner or null, see that the control block outlives the object, build a cache and an observer list that never keep anything alive by themselves, watch two objects that own each other leak, and fix the cycle with a weak back edge.