by Carl Barron <cbarron413@[EMAIL PROTECTED]
>
Apr 30, 2008 at 10:27 AM
In article
<69f5f1ed-a5bc-4409-b1f9-b2671b85da02@[EMAIL PROTECTED]
>,
Bharath <tiromarch08@[EMAIL PROTECTED]
> wrote:
> Hello All,
> I was trying the below example for which I have a doubt. My doubt is
> that why is virtual needed for function "dummy" in class CBase which
> makes program compile?
> Secondly, As per my current understanding of dynamic cast, pba is a
> object of CDerived which RTTI knows and hence cast should be
> successful. Isn't it? Which concept I didn't understand here ?
>
because the base claass with no virtual functions/dtor does not
generate any RTTI info, since the base class has no runtime virtual
calls nothing needs to be generated, It should work if the base class
had a virtual dtor.
--
[ See http://www.gotw.ca/resources/clcm.htm
for info about ]
[ comp.lang.c++.moderated. First time posters: Do this! ]