~/talk

The Nightmare of Initialization in C++

Talkat CppCon 2018 · 2018-09-23..09-28· [software-architecture]
links:none on file
slides:none on file

Claims that there are 19 ways to initialize an int and shows real breakage: copy vs direct vs brace vs auto+brace produce different types and overload resolution, initializer_list changes make vector{1} differ from vector(1), and compilers (Clang 3.8, GCC 5, MSVC 2015) only gradually adopt fixes. Demonstrates C++14/17/20 fixes (initializer_list rules, prvalue materialization, atomic and aggregate adjustments) and advises auto + {} is dangerous and to prefer braces as the default.

AI-written summary · about

  1. 0:00Introduction
  2. 1:11History of initialization
  3. 8:08Uniform initialization basics
  4. 12:51Almost Always Auto rule
  5. 19:52C++17 improvements
  6. 24:44Value categories in C++17
  7. 31:14Most vexing parse
  8. 34:56Narrowing conversions
  9. 36:04Initializer lists
  10. 41:28Enumerations
  11. 44:20Explicit constructors
  12. 47:20Aggregates in C++17
  13. 50:13Arrays vs vectors
  14. 52:02Atomic initialization
  15. 53:32Assert macros
  16. 54:17Style guide recommendations
  17. 58:17Call to action
~/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.