// Function declaration.
template <typename T1,
typename T2,
typename RT> RT max (T1 a, T2 b);
// Function call.
max <int,double,double> (4,4.2)
// Function call.
max <int> (4,4.2)
One case may be when you need to specify the return type.
Is there any other situation which requires the argument types to be specified manually?
(1) When there is no argument to the function and still it’s a
templatetype, then you may have to specify the arguments explicitlyUsage:
(2) You want to distinguish between value and reference.
Usage:
(3) Need another type to be deduced instead of the natural type.
Usage:
(4) Two different argument types are provided for a single template parameter
Usage: