Compiler Error C2784
TOC
Collapse the table of content
Expand the table of content
Important This document may not represent best practices for current development, links to downloads and other resources may no longer be valid. Current recommended version can be found here. ArchiveDisclaimer

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.

The following sample generates C2784:

// C2784.cpp
template<class T> class X {};
template<class T> void f(X<T>) {}

int main() {
   X<int> x;
   f(1);   // C2784

   // try the following line instead
   f(x);
}
Show:
© 2016 Microsoft