Export (0) Print
Expand All
Expand Minimize

Compiler Error C2784

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

The compiler cannot determine a template argument from the supplied function arguments.

Example

// C2784.cpp
template<class T> class X
{
};

template<class T> void f(X<T>)
{
}
int main()
{
   f(1); // C2784
   // try the following lines instead
   // X<int> x;
   // f(x);
}
Show:
© 2014 Microsoft