No because what you really have is two base classes without any knowledge of each other.
Italk Parent
/ /
| |
+---------+
|
Child
If Parent and Italk had two variables named i, there'd be two instances of "i", ITalk::i and Parent::i. To access them you'd have to fully qualify which one you wanted.
The same is true of methods, lChild has two methods called SayHi and you need to clarify which one you mean when calling SayHi because the multiple inheritance has made it ambiguous.
You have Parent's SayHi
lChild->Parent::SayHi();
and Italk's SayHi:
lChild->ITalk::SayHi();
The latter is pure virtual and because its abstract needs to be overridden locally in Child. To satisfy this you'll need to define
Child::SayHi();
Which would now hide Parent::SayHi() when invoking SayHi without scoping it to the class:
lChild->SayHi() //parent's now hidden, invoke child's
Of course Child::SayHi() could call Parent::SayHi():
void Child::SayHi()
{
Parent::SayHi();
}
which would solve your problem.
与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…