You receive a C2059 syntax error when you initialize a static data member of a template class (179273)
The information in this article applies to:
- Microsoft Visual C++, 32-bit Enterprise Edition 5.0
- Microsoft Visual C++, 32-bit Enterprise Edition 6.0
- Microsoft Visual C++, 32-bit Professional Edition 5.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 Q179273 SYMPTOMS
The compiler generates the following errors when compiling the sample code
shown below (the code initializes a static data member of a template
class):
C2059: syntax error : syntax error : 'string'
C2063: 'identifier' : 'r' : not a function
C2040: 'operator' : 'r' : 'class Register (void)' differs in levels of
indirection from 'class Register'
RESOLUTION
To work around this problem, use the assignment operator when initializing
the static data member of a template class.
STATUSMicrosoft has confirmed that this is a bug in the Microsoft products that are listed at the beginning of this article.
This problem was corrected in Microsoft Visual C++ .NET.
Modification Type: | Major | Last Reviewed: | 6/2/2005 |
---|
Keywords: | kbtshoot kbBug kbfix kbNoUpdate KB179273 kbAudDeveloper |
---|
|