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 and shows how to fix it:
// C2784.cpp
template<class T> class X {};
template<class T> void f(X<T>) {}
int main() {
X<int> x;
f(1); // C2784
// To fix it, try the following line instead
f(x);
}
Feedback
https://aka.ms/ContentUserFeedback.
Coming soon: Throughout 2024 we will be phasing out GitHub Issues as the feedback mechanism for content and replacing it with a new feedback system. For more information see:Submit and view feedback for