Compiler Error C2784

'declaration' : could not deduce template argument for 'type' from 'type'

The compiler cannot deduce a template argument from the supplied function arguments. For example:

template<class T> class X { };
template<class T> void f(X<T>) {}
f(1);

The compiler cannot deduce what the template argument associated with T is from the above function call. The following code will work:

X<int> x;
f(x);