In this chapter, we discussed the fundamental concepts of object-oriented programming. We touched on the low-level details of classes and the compiler implementation of the C++ object model. Knowing how to design and implement classes without actually having classes helps a lot in using the classes the right way.
We also discussed the need for inheritance and tried to employ composition instead of inheritance wherever it might be applicable. C++ supports three types of inheritance: public, private, and protected. All of these types have their applications in particular class designs. Finally, we understood the use and power of polymorphism by bringing an example that drastically increases the convenience of the client code.
In the next chapter, we will learn more about templates and template metaprogramming, which we will use as the basis to dive into a new C++20 feature...