dynamic_cast to another base class

Aseem Rastogi aseem@india.tejasnetworks.com
Wed Mar 8 06:47:00 GMT 2006

g++ 2.96.

Class C doesn' t have virtual functions BUT has a virtual destructor.

Can you point me to some literature which explains as to why 
dynamic_cast requires virtual functions ?


John Love-Jensen wrote:

>Hi Aseem,
>>Why does dynamic_cast fail ??
>Worked on my machine.
>What version of GCC are you using?
>The only other reason I can think of that it could be failing is if your
>class A, B, C, D lack virtual functions (which are required for dynamic_cast
>to work).

If you are good, you will be assigned all the work.  If you are real good, you will get out of it

More information about the Gcc-help mailing list