We must carefully differentiate between the two steps in instantiating a template function to match a particular call—first, the types of the template parameters are deduced from the argument types (a process referred to as type deduction). Once the types are deduced, the concrete types are substituted for all parameter types (this is a process called type substitution). The difference becomes more obvious when the function has multiple parameters.
Type substitution in template functions
Type deduction and substitution
Type deduction and substitution are closely related, but not exactly the same. Deduction is the process of guessing—What should the template type, or types, be in order to match the call? Of course...