How do you initialise your members?
(Non) Static Data Members Initialization, from C++11 till C++20
by Bartlomiej Filipek
From the article:
With Modern C++ and each revision of the Standard, we get more comfortable ways to initialize data members. There’s non-static data member initialization (from C++11) and inline variables (for static members since C++17).
In this blog post, you’ll learn how to use the syntax and how it has changed over the years. We’ll go from C++11, through C++14, and C++17 until C++20.
Updated in July 2022: added more examples, use cases, and C++20 features.
Add a Comment
Comments are closed.