An (In-)Complete Guide To C++ Object Lifetimes
summary
Concrete rules and examples about when objects actually come into existence and die, not abstract advice: when placement new or std::start_lifetime_as is required, when implicit object creation (malloc, allocation functions, memcpy) makes the compiler “time travel” to invent objects, how provenance defeats naive pointer aliasing, why const-on-heap vs static matters, how unions, mmap/shared memory and std::bit_cast interact with lifetimes, the roles of std::launder and the C++20/23/26 wording changes.
AI-written summary · about
chapters (9)
- 0:00Introduction
- 0:35Object Lifetime
- 3:05Structure
- 7:00New Delete
- 7:49Temporary Objects
- 12:11Placement New
- 17:53Implicit Object Creation
- 26:14Provence
- 30:46Conclusion
related talks
01h 00mAn (In-) Complete Guide to C++ Object Lifetimes
01h 01mC++ Object Lifetime: From Start to Finish
58mTaking a Byte Out of C++ - Avoiding Punning by Starting Lifetimes
58mUnderstanding and Mastering C++'s Complexity
01h 03mLifetime Safety in C++: Past, Present and Future
44mThis is why we can('t) have nice things
01h 01mEmbracing PODs Safely Until They Die
49mBack to Basics: C++ Smart Pointers
