##A.hh
template void func(T t) {}
template<> void func(int t) {}
void func2();
##A.cpp
void func2() {}
##main.cpp
func(\"hello\");
As template<> void func
is a function overload rather than a function template (i.e., all types are known at the point of definition so it is no longer a template), it must be marked as inline
or defined in a .cpp file to avoid multiple definition errors, just as with any other function definition.