~/talk

Initialization in modern C++

Talkat Meeting C++ 2018 · 2018-11-15..11-17· [rust]
links:none on file
slides:none on file

Survey of every initializer from C to C++20: precise rules, surprising pitfalls and fixes. Shows when code does value initialization vs zero initialization, how list initialization greedily prefers std::initializer_list and breaks templates and macros, and how C++17 adds guaranteed copy elision while C++20 plans designated fields and paren-based aggregate init. Recommends concrete style rules: use equals for builtins, braces for aggregates and initializer_list, and parens for constructors (or be consistent). Includes a printable table of syntaxes and outcomes.

AI-written summary · about

  1. 0:00Intro
  2. 3:07Default initialisation
  3. 5:26Copy initialisation
  4. 11:44Direct initialisation
  5. 18:20Value initialisation
  6. 24:10Uniform initialisation
  7. 33:18List initialisation
  8. 37:27List init nested braces
  9. 43:58Guaranteed copy elision
  10. 47:35Designated initialisation
  11. 52:31Aggregate initialisation from parens
  12. 54:13Recommendations
~/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.