R
Rui Maciel
Consider that I have the following classes: Base, A, B, Derived
Class A inherits class Base and class Derived inherits both class A and class B. So, the
inheritance diagram would be something like (mind the ASCII art)
Base
|
A B
-------
|
Derived
Let's assume that I get a pointer to an object of type Base. Yet, I need to access attributes which
are defined in class B.
The thing is, a dynamic_cast<> from Base to B fails to materialize and a reinterpret_cast<> also
appears to fail.
So, is this possible? If so, what's the secret?
Thanks in advance,
Rui Maciel
Class A inherits class Base and class Derived inherits both class A and class B. So, the
inheritance diagram would be something like (mind the ASCII art)
Base
|
A B
-------
|
Derived
Let's assume that I get a pointer to an object of type Base. Yet, I need to access attributes which
are defined in class B.
The thing is, a dynamic_cast<> from Base to B fails to materialize and a reinterpret_cast<> also
appears to fail.
So, is this possible? If so, what's the secret?
Thanks in advance,
Rui Maciel