First page Back Continue Last page Graphics
Function Template (cont.)
“Use templates if you need functions that apply the same algorithm to a variety of types.”
Older compilers don't support templates.
Note, you don't end up with shorter code.
You still have one function definition per type, but you avoid step and repeat errors when entering the same code multiple times.
And, you avoid missing changes for some functions when changes occur1