Template specializations allow us to make the generated template code differently for some types—not just the same code with different types substituted, but completely different code. There are two kinds of template specialization in C++—the explicit, or full, specialization and the partial specialization. Let's start with the former.
Template specializations
Explicit specialization
Explicit template specialization defines a special version of the template for a particular set of types. In an explicit specialization, all generic types are replaced by specific, concrete types. Since the explicit specialization is not a generic class or function, it does not need to be instantiated later. For the same reason...