FIX: C2084 When Template Class Constructor Has No Body (150573)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Editions 4.1
- Microsoft Visual C++, 32-bit Enterprise Edition 4.2
- Microsoft Visual C++, 32-bit Professional Edition 4.2
This article was previously published under Q150573 SYMPTOMS
The following error occurs when a template class is explicitly instantiated
and it has more than one constructor, at least one of which does not have a
body defined and at least one of which is defined outside of the class:
error C2084: function '<function name>' already has a body
WORKAROUND
This is the preferred workaround. Give every constructor a body. The
body is defined inside or outside the template class.
-or- NOTE: the sample code in this article gives examples of explicit versus
implicit template instantiation.
STATUS
Microsoft has confirmed this to be a bug in the Microsoft products listed
at the beginning of this article. This bug was corrected in Visual C++
version 5.0.
Modification Type: | Minor | Last Reviewed: | 7/5/2005 |
---|
Keywords: | kbbug kbCompiler kbCPPonly kbfix kbVC500fix KB150573 |
---|
|