I could swear the syntax is correct. I played around and changed class into typename. Still no go.
How do i write this so the 2nd function template kicks in?
#include <iostream>
template<typename T, typename TT> void fn(T t, TT tt) { std::cout<<"general"<<std::endl; }
template<> void fn<T, bool>(T t, bool tt) { std::cout<<"bool"<<std::endl; }
int main(){
fn("", "");
fn("", true);
}
There are no partial specializations of function templates. Just use overloading instead: