References
Related materials and links about data member initialization in C++:
Proposals for C++ features:
- N2756 - Non-static data member initializers for C++11,
- P0683 - Default Bit Field Initializer for C++20,
- P0386 - Inline Variables C++17,
- P0329 - Designated Initializers C++20,
- P0960 and P1975 - Aggregate initialization from a parenthesized list for C++20.
Valuable resources for C++:
- C++ Standard Draft - N4868 (October 2020 pre-virtual-plenary working draft/C++20 plus editorial changes),
- C++ compiler support - C++Reference - a list of features and their compiler support since C++11,
- C++ Core Guidelines - a community-edited and open guideline for C++ style, lead by Bjarne Stroustrup and Herb Sutter.
Books:
- “Embracing Modern C++ Safely” by J. Lakos, V. Romeo , R. Khlebnikov, A. Meredith, a wonderful and very detailed book about latest C++ features, from C++11 till C++14 in the 1st edition.
- “Effective Modern C++: 42 Specific Ways to Improve Your Use of C++11 and C++14” by Scott Meyers
Presentations:
- Core C++ 2019: Initialisation in modern C++ by Timur Doumler,
- CppCon 2018: “The Nightmare of Initialization in C” by Nicolai Josuttis,
- CppCon 2021: Back To Basics: The Special Member Functions by Klaus Iglberger,
- ACCU 2022: What Classes We Design and How - by Peter Sommerlad,
- CppCon 2018 “The Bits Between the Bits: How We Get to main()” - by Matt Godbolt.
Articles and other links:
- Non-Static Data Members Initialization - C++ Stories - initial source for the book,
- What happens to your static variables at the start of the program? - C++ Stories,
- Always Almost Auto Style by Herb Sutter,
- C++ Core Guidelines - C51 and C52 - about delegating and inheriting constructors,
- Modern C++ Features - Inherited and Delegating Constructors by Arne Mertz,
- Trivial, standard-layout, POD, and literal types at Microsoft Docs,
- Modern C++ Features - Uniform Initialization and initializer_list by Arne Mertz,
-
The cost of
std::initializer_listby Andrzej Krzemieński, - Objects, their lifetimes and pointers by Dawid Pilarski,
- Tutorial: When to Write Which Special Member by Jonathan Müller,
- The implication of const or reference member variables in C++ by Lesley Lai,
- Brace initialization of user-defined types by Glennan Carnie.