In this recipe, we will learn how to erase types using inheritance. When type erasing is discussed, inheritance is not usually considered, but in reality, it is the most common form of type erasing used in C++. This recipe is important because it will discuss what type erasing is and why it is so useful in everyday applications without simply removing type information—a practice that is common in C.
How to erase a type with inheritance
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 cmake
This will ensure your operating system has the...