A function template defines how a family of functions can be generated. A family here means a group of functions that behave similarly. As shown in the following diagram, this includes two phases:
- Creating a function template; that is, the rules on how to write it.
- Template instantiation; that is, the rules that are used to generate functions from their template:
In part I of the preceding diagram, we discuss the format that will be used to create a function template for generic types, but with respect to the specialized template, which we also refer to as the primary template. Then, in part ...