~/lightning

Initialisation in Modern C++

Lightningat C++Now 2022 · 2022-05-01..05-06· [c-and-cpp]
links:none on file
slides:none on file

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

~/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.