The statement below will cause ambiguity because it is violating a rule for template argument deduction. That rule is: if a template parameter is used more than once in the function parameter list, then each deduced type for its template argument must match the first deduced type.
template void func (type t1, type t2); func(4, 5.6);
As you can see, the code is deducing two different types of the template argument for the template parameter ‘type’. You can resolve this situation by using Explicit Template Argument:
func(4, 5.6)
Now the template argument for “type” is explicitly specified to “int”. Thus the type of template parameter is fixed and does not depend on implicit template argument deduction anymore.