Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 30s8 days 9 hours 54 minutes 30 seconds.
Price your future right. 60% off with code BLACKSCHOLES at USD checkout. Offer ends in 8d 09h 54m 30s8 days 9 hours 54 minutes 30 seconds.

Sign in to watch this lesson
Ownership Types, Views and Type Erasure · 3:39
std::unique_ptr is the standard library's exclusive owner: one owner, one delete, and ownership that moves but never copies. We follow an order from a factory into a vector and then a member, measure the pointer's size with different deleters on a real Mac, and see why a unique_ptr is the ideal factory return type.