The Static Initialization Order Fiasco
summary
Explains the static initialization order fiasco in C++: why objects with static storage duration across translation units can be initialized in an undefined order, causing bugs. Describes the problem's mechanics and shows common techniques to avoid it, such as using function-local statics (construct on first use) and other initialization patterns, with references to slides and a C++ survey.
AI-written summary · about
chapters (6)
- 0:00Static Initialization Order Fiasco
- 4:13Lifetime and construction
- 14:18Dynamic vs static init
- 22:50Global object impacts
- 30:20Solutions and best practices
- 38:02Summary
related talks
11mLightning talk: Manual (de)initialization A Rust and C++
01h 01mInitialization in modern C++
01h 01mC++ Object Lifetime: From Start to Finish
35mAn (In-)Complete Guide To C++ Object Lifetimes
44mThis is why we can('t) have nice things
56mThe C++ Execution Model
01h 00mAn (In-) Complete Guide to C++ Object Lifetimes
58mUnderstanding and Mastering C++'s Complexity
