•We can explicitly specify both types, or just the first type. However, it is not possible to explicitly
specify the type
for the second type without specifying the type for the first type as well.
n
narray_copy<int [],
int []>(int_array1, int_array2, 100);
narray_copy<float
[]>(real_array, int_array1, 100);
n
•We can have the return type also be based on a type dependency by specifying an additional type in our template's formal argument list. Because a return
type cannot be deduced,
clients must specify that type explicitly
when calling the function.
n
n