BUG: Error C2783 - Cannot Deduce Non-Type Template ParameterLast reviewed: May 21, 1997Article ID: Q165803 |
The information in this article applies to:
SYMPTOMSThe sample code in the MORE INFORMATION section causes the compiler error C2783:
"'declaration' : could not deduce template argument for 'identifier'" RESOLUTIONThe workaround is to avoid argument deduction by specifying the template- parameter-list when calling the function template.
STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. We are researching this bug and will post new information here in the Microsoft Knowledge Base as it becomes available.
MORE INFORMATIONThe following sample code demonstrates the problem and the workaround:
SAMPLE
/* Compile options needed: none */ template <int I> struct C { int a[I] ; }; template <int I> int F(C<I> a) { return I ; } int main () { int i; C<4> CObj ; i = F(CObj); // Workaround: Comment the line above. // Uncomment the following line // i = F<4>(CObj); return 0 ; } |
Keywords : CLIss CPPLngIss vcbuglist500 kbbuglist
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |