Article ID: 149327 - Last Review: July 5, 2005 - Revision: 1.1 FIX: C2440 Expanding Template with a Pointer to a Nested ClassThis article was previously published under Q149327 On This PageSYMPTOMS
At the point where a class template is expanded using a pointer to a nested
class, the compiler reports the following errors (generated by the sample
code listed in this article):
[FileName](14) : error C2440: 'initializing' : cannot convert from
'class A::B' to 'class A::B *' (new behavior; please see help)
[FileName](14) : error C2439: 't' : member could not be initialized
RESOLUTION
There are three possible workarounds to this problem. Each is stated here
in terms of the sample code included in this article:
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article. MORE INFORMATION
In this case, the problem is caused by the attempt to initialize the
data member t.
Sample CodeAPPLIES TO
| Article Translations
|

Back to the top
