BUG: Explicitly Specified Template Functions Not Overloaded Correctly (240871)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Professional Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 6.0
- Microsoft Visual C++, 32-bit Learning Edition 6.0
This article was previously published under Q240871 SYMPTOMS
If all the template parameters are not used in function arguments or return type of a template function, the template functions are not overloaded correctly.
Please refer to the sample in the "More Information" Section for details.
CAUSE
The bug is the result of the way the compiler decorates template function names. Name Decoration uses the arguments and return type and doesn't use the explicitly specified template argument type. Therefore, all three template function instantiations receive the same decorated name, as seen in the sample code the "More Information" section.
RESOLUTION
Use dummy arguments to the function.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbBug kbCompiler kbCPPonly kbLangCPP kbpending kbSTL kbtemplate KB240871 |
---|
|