Anatomy of a Smart Pointer
summary
Covers concrete designs and tradeoffs: object‑based vs container‑based reference counting with the actual cost differences and simpler smart‑pointer logic, when unique_ptr avoids ownership headaches, and how shared_ptr uses a separate control block. Shows practical tools: make_shared single allocation for better locality, custom deleter for malloc/free interop, and enabled_shared_from_this to recreate owning references from raw pointers. Emphasizes prefer unique when possible and use make_shared for efficiency.
AI-written summary · about
chapters (7)
- 0:00Introduction to smart pointers
- 0:44Smart pointer basics
- 2:25Reference counting strategies
- 4:36Unique pointer and deleters
- 5:43Shared pointer implementation
- 8:24Optimization with make_shared
- 9:40Advanced features and summary








