FIX: Template Friend Function Causes Compiler Error C2248 (166109)
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
This article was previously published under Q166109 SYMPTOMS
The compiler generates a compiler error C2248 as follows:
Error C2248: 'member' : cannot access member declared in class 'class'
under the following circumstances:
- If a class declares a template function as a friend function, and
- If the template function definition appears after the class definition.
RESOLUTION
Do not declare a template function as a friend of a class.
STATUSMicrosoft has confirmed that this is a problem in the Microsoft products that are listed at the beginning of this article. This problem was corrected in Microsoft Visual C++ version 6.0.
| Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
|---|
| Keywords: | kbBug kbfix kbVC600fix KB166109 |
|---|
|