~/talk

Smart Pointers in C++

Talkat C++ on Sea 2025 · 2025-06-23..06-25· [c-and-cpp]
slides:none on file

Covers concrete failure modes and fixes: using ptr.get on a unique_ptr produces a double delete when ownership isn’t transferred; unique_ptr<T[]> or make_unique must be used for arrays to avoid undefined behavior; custom deleters that capture locals by reference cause use‑after‑free; shared_ptr imposes a control‑block and atomic overhead and can leak via cycles unless replaced by weak_ptr; the aliasing constructor can keep huge objects alive; tools recommended are AddressSanitizer, ThreadSanitizer, Valgrind, clang static analyzer, PVS Studio and cppcheck; prefers make_unique/make_shared and CI sanitizers.

AI-written summary · about

  1. 0:00Introduction to pointers
  2. 1:04Ownership and common bugs
  3. 4:09Why this talk matters
  4. 5:30Raw pointers and RAII
  5. 7:07Smart pointers overview
  6. 8:59Unique pointer usage
  7. 11:11Unique pointer pitfalls
  8. 16:36Shared pointer fundamentals
  9. 19:56Circular references
  10. 22:38Weak pointer usage
  11. 25:30Shared pointer pitfalls
  12. 30:40Performance comparisons
  13. 32:49Detection tools
  14. 36:33Best practices
  15. 40:09Legacy migration strategies
~/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.