3 ms·
The mention of the number of pages seems passive aggressive. Here's what the book actually covers and it is "initialization and related areas" which you could
by heeen2 4y ago
The mention of the number of pages seems passive aggressive.
Here's what the book actually covers and it is "initialization and related areas" which you could fill many pages about any language if you include examples, a quiz, some foundational chapters:
The book contains 14 chapters in the following structure:
Chapters 1 to 5 create a foundation for the rest of the book. They cover basic initialization rules, constructors, destructors, and the basics of data members.
Chapter 6 is a short quiz on constructors. You can check your knowledge from the first “part” of the book.
Chapter 7 Type deduction: auto, decltype, AAA
Chapter 8 describes Non-static Data Member Initialization (NSDMI), a powerful feature from C++11 that improves how we work with data members. At the end of the chapter, you can solve a few exercises.
Chapter 9 discusses how to initialize container-like data members.
Chapter 10 contains information about non-regular data members and how to handle them in a class. You’ll learn about const data members, unique_ptr as a data member, and references.
Chapter 11 describes static non-local variables, static objects, various storage duration options, inline variables from C++17 and constinit from C++20.
Chapter 12 moves to C++20 and describes Designated Initializers, a handy feature based on similar thing from the C language.
Chapter 13 shows various techniques like passing strings into constructors, strong typing, CRTP class counter, Copy and swap idiom, and more.
Chapter 14 is the final quiz with questions from the whole book.
And there are two appendices:
Appendix A - a handy guide about rules for compiler-generated special member functions.
Appendix B - answers to quizzes and exercises.