In this recipe, we will learn how to erase (or ignore) type information leveraging C++ templates. You will learn how C++ templates can be used to implement a C++ concept and how this type of erasure is used in the C++ Standard Library. This recipe is important as it will teach you how to better design your APIs as specifications that do not rely on specific types (or, in other words, how to write generic code).
Using C++ templates to write generic functions
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...