such are the codes:
template<typename T>
struct ST{
ST();
ST(T t){}
};
template<typename T>
void fun(ST<T> t, T a){
}
int main(int argc, char * argv[])
{
ST<int> t=2;
fun(2,2);
}
compile with g++ 4.8.2 errinfo:
no matches for fun(int,int)
Candidate is:
template void fun(ST, T)
template argument deduction/substitution failed:
mismatched types ‘ST’ and ‘int’