The information in this article applies to:
SYMPTOMSA class template that makes an explicit call to destructor through a pointer of the template argument <type_name> generates the following error if the class template is instantiated with a class type:
RESOLUTIONYou can work around this problem by using the scope resolution operator (::) when calling the destructor:
If the pointer points to an object of a derived class, the objects's
virtual destructor is not called. In this case, it may be nessary to call
another virtual function instead, which then calls the virtual destructor.
Also, this syntax can cause problems if the template is instantiated with a simple type. See the "References" section of this article for more information. STATUSMicrosoft has confirmed this to be a bug in the Microsoft products listed at the beginning of this article. This problem was fixed in Microsoft Visual C++, 32-bit Edition, version 4.0. MORE INFORMATIONSample Code to Demonstrate Problem
REFERENCESFor more information, please see the following article in the Microsoft Knowledge Base: Q130546 BUG: C2227 & C2653 on Explicit Destructor Call in Template Additional query words: 2.00 2.10 9.00 9.10
Keywords : kbCompiler kbCPPonly kbVC |
Last Reviewed: January 20, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |