The information in this article applies to:
SYMPTOMSWhen casting a const pointer of derived class to a const pointer of base class, the compiler generates the following error message: where name1 and name2 refer to the names of your derived class and base class respectively. RESOLUTIONCast the derived class const pointer to a derived class non-const pointer. Then use the derived class non-const pointer in the dynamic_cast expression. See the MORE INFORMATION section of this article for sample code and a workaround. 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 INFORMATIONThe following sample code demonstrates the problem and generates the compiler error C2682. The workaround is shown in the comments in the sample code below. Sample Code
Additional query words: kbVC400bug
Keywords : kbCompiler kbVC500fix |
Last Reviewed: January 31, 2000 © 2000 Microsoft Corporation. All rights reserved. Terms of Use. |