FIX: C2512 Instantiating Template in Member Initializer (171064)
The information in this article applies to:
- Microsoft C/C++ Compiler (CL.EXE)
This article was previously published under Q171064 SYMPTOMS
When a member initializer instantiates a template class that takes a const
parameter in its constructor, you may receive the following error:
error C2512: no appropriate default constructor available
RESOLUTION
Declare a global object of the template class specialization that is used
in the member initializer. When optimizations are used, this unreferenced
global should be optimized away.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This problem was corrected in Visual C++ version 6.0 for Windows.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbBug kbfix kbVC600fix KB171064 |
---|
|