~/lightning

Anatomy of a Smart Pointer

Lightningat CppCon 2014 · on Sunday, 2014-09-07· [rust]
slides:none on file

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

  1. 0:00Introduction to smart pointers
  2. 0:44Smart pointer basics
  3. 2:25Reference counting strategies
  4. 4:36Unique pointer and deleters
  5. 5:43Shared pointer implementation
  6. 8:24Optimization with make_shared
  7. 9:40Advanced features and summary
~/search
type to search 6,249 conferences, 138,987 speakers and 185,172 talks
~/help
cmdctrl k
search every conference, speaker and series
/
focus the filter search
h
home
c
conferences
s
speakers
e
series
t
light / dark — the status bar button does the same
?
this help
esc
close this, then clear every filter — or just the search, while you are typing in it

Ignored while you are typing. Pages without a filter rail have no search to focus.