C++ is not just an object-oriented language, and it doesn't just offer dynamic polymorphism, so design in C++ is not just about the Gang of Four patterns. In this chapter, you will learn about the commonly used C++ idioms and design patterns and where to use them.
The following topics will be covered in this chapter:
- Writing idiomatic C++
- Curiously recurring template pattern
- Creating objects
- Tracking state and visiting objects in C++
- Dealing with memory efficiently
That's quite a list! Let's not waste time and jump right in.
Technical requirements
The code from this chapter requires the following tools to build and run:
- A compiler supporting C++20
- CMake 3.15+
The source code snippets from the chapter can be found ...