Let's assume there is such class hierarchy:
class A //base class
class B //interface
class C : public A, public B
Then C object is created:
A *object = new C();
Is it possible to cast object to B ?
Important: I assume I don't know that object is C. I just know that it implements interface B
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…