~/talk

C++ Object Lifetime: From Start to Finish

Talkat CppCon 2023 · on Wednesday, 2023-10-04· at 16:45· Maple 3/4/5, 6700 North Gaylord Rockies Boulevard· [rust]
slides:none on file

Defines exactly when lifetime starts (storage obtained and constructor completes) and ends (destructor or storage release), demonstrates that temporaries are destroyed at the end of the full expression except for the reference lifetime extension cases, shows how return value optimization usually avoids copies, reproduces a real deadlock caused by a temporary holding a mutex and how the fix removes it, uses CppInsights to inspect generated code, and notes the C++23 range-for fix that made one common pattern safe.

AI-written summary · about

  1. 0:00Introduction and basics
  2. 4:54Object lifetime principles
  3. 15:21Resource management with RAII
  4. 18:33References and dangling issues
  5. 29:42Temporary object lifetimes
  6. 40:12Lifetime extension exceptions
  7. 46:24Deadlock case study
  8. 49:53Q&A session
~/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.