The other answers explain what's going on: when template argument deduction finds two ways to deduce a template argument, it looks at each alone and they all must agree exactly.
You can probably get this class working the way you intended by making sure the second use of t
is in a "non-deduced context":
template<typename T>
struct identity { typedef T type; };
struct blah
{
template<class t>
blah(void(*)(t), typename identity<t>::type){}
};
This way when the blah
constructor is called, C++ will deduce t
from the function pointer, but won't try to deduce it from the second argument. The type deduced then gets substituted in both places.