Since int *
is not implicitly convertible to char *
nor to const char *
, the template function will be called. Removing the template function would result in compile time error.
Suggestion: There is great value in playing around with the compiler yourself. You can add lines like
std::cout << "template function called.\n";
into your overloads or use the debugger to do that kind of stuff. It's a great learning experience. You might also simply read some C++ books for an introduction.