I tried to write this function with a default template argument:
template<typename A, typename B>
void func(int i1, int i2, A a, B b = 123){
...
}
In my mind I can call it like this: func(1, 2, 3)
and compiler should deduce type B
as int
from default value, but I get no instance of overloaded function
.
Is it incorrect C++ construction and compiler can't deduce type in this case?