FIX: C2065 Error on Functions Returns Template Class By Value (130276)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Professional Edition 2.0
- Microsoft Visual C++, 32-bit Professional Edition 2.1
This article was previously published under Q130276 SYMPTOMS
Any reference to a template function that returns a template class by
value generates these errors:
error C2065: 'function name' : undeclared identifier
error C2064: term does not evaluate to a function C2065
RESOLUTION
Modify the function to return a reference to the template class instead of
returning by value. In the "Sample Code" section of this article, function
'f1' returns a template class by value and fails. Function 'f2' returns a
template class by reference and succeeds.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was fixed in Microsoft
Visual C++, 32-bit Edition, version 4.0.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbbug kbCompiler kbCPPonly kbfix KB130276 |
---|
|