(This should have been on the gcc-help list.)

> I may be remembering wrong, but -- doesn't dynamic_cast look for a vtable?

It uses a vtable if one is present, it can't cause one to be
introduced, so ...

>So if you do a dynamic cast mentioning that class you'd get such a reference.

No.

> Or is that an error when applied to a non-polymorphic class?

You can use dynamic_cast to upcast (i.e. from derived to base) for
non-polymorphic class types. It is an error to downcast (from base to
derived) for a non-polymorphic class type.


Reply via email to