FIX: C2989 Declaring Template Class in a NamespaceLast reviewed: September 19, 1997Article ID: Q163995 |
The information in this article applies to:
SYMPTOMSA template class is defined inside a namespace that has the same name as a non-template class declared at global scope. When you compile this construct, the following error message appears:
error C2989: '<classname>' : template class has already been defined as a non-template class RESOLUTIONThere are 3 ways to work around this problem.
STATUSMicrosoft 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.
MORE INFORMATION
Sample Code
/* Compile options needed: none */ class test {}; // Move this line below namespace tester for resolution #2. namespace tester { template <class T> class test {}; } |
Additional query words: C2989 template namespace
© 1998 Microsoft Corporation. All rights reserved. Terms of Use. |