In this recipe, we will learn how to create polymorphism without the need for virtual inheritance. Instead, we will use compile-time inheritance (called static polymorphism). This recipe is important because static polymorphism does not incur the same performance and memory usage penalties as runtime, virtual inheritance (as no vTable is required), at the expense of readability and the inability to leverage the runtime benefits of virtual subclassing.
Improving performance with static polymorphism
Getting ready
Before beginning, please ensure that all of the technical requirements are met, including installing Ubuntu 18.04 or higher and running the following in a Terminal window:
> sudo apt-get install build-essential git...