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

Sign in to watch this lesson
Ownership Types, Views and Type Erasure · 3:44
Pimpl (pointer to implementation) moves a class's data members and their includes out of the header and behind a unique_ptr, so the class shrinks to one pointer and clients stop recompiling when its insides change. We watch the client fail to compile because the implicit destructor is generated where Impl is only a name, then fix it by declaring the destructor and moves in the header and defining them in the .cpp, write a deep copy, and see why shared_ptr doesn't have the problem.