Initialisation in Modern C++
summary
C++20 adds direct aggregate initialization using parentheses which enables perfect forwarding for aggregates so functions like make_shared and in_place_construct now accept aggregates, and it fixes aggregate use inside macros. Specific pitfalls: parenthesis init allows narrowing conversions, it does not permit brace elision, it does not extend the lifetime of temporaries, and implicit member initialization uses copy-list rules so types with explicit constructors fail unless values are provided. Empty parens perform value initialization (zero initialization) rather than aggregate initialization.
AI-written summary · about
related talks
05mDirect Aggregate Initialisation
01h 03mC++20: The small things
01h 28mProgramming in Modern C with a Sneak Peek into C23
01h 06mModern C and What We Can Learn From It
01h 23mHow C++20 Can Simplify std::tuple
56mCute C++ Tricks (and what you can learn from them): Part 2 of N
54mTypical C++, But Why?
05mEasing into Modern C++
