~/talk

The Smart Pointers I Wish I Had

Talkat CppCon 2019 · 2019-09-15..09-20· [c-and-cpp]
links:none on file
slides:none on file

Shows a concrete fix: convert non-owning raw pointers to a typed non-owning pointer (uses the C++20 observer_ptr idea, implemented a custom borrowed_ref/borrowed_ptr), removes .get from internal smart pointers, and tightens APIs so ownership is explicit. A latent bug that takes "two months" to find motivates the change; a codebase migration takes weeks to roll back and rework when performance regresses but ultimately prevents those lifetime races. Claims roughly "70% solved" by observer_ptr ergonomics and reports multi-year, incremental adoption across a million-line codebase.

AI-written summary · about

  1. 0:00Intro
  2. 0:47My Domain
  3. 3:02Click-Bait Title
  4. 4:42Definitions
  5. 5:53Using Tools to Detect Lifetime Issues
  6. 7:11Guideline 1: No Owning Raw Pointers
  7. 9:19Too Easy to Type the Wrong Thing?
  8. 12:10Thesis 2
  9. 12:28Guideline 2: No Non-Owning Raw Pointers
  10. 13:18Thesis 3
  11. 13:51observer_ptr in Brief
  12. 17:50get() considered harmful?
  13. 21:27Implicit Construction?
  14. 24:47Fixing(?) Raw References
  15. 26:51Non-Local Reasoning
  16. 28:28Async Changes Understanding of Lifetime
  17. 31:24Apply Google's Rules...
  18. 32:27Apply Smart Pointer Guidelines...
  19. 33:48Non-Owning Smart Pointers
  20. 40:13Guideline 3
  21. 42:29Migrating Code
  22. 46:29Appendix A
  23. 46:45Multi-threaded races
  24. 47:26Appendix B
~/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.