I have following architecture
class A_Base {
virtual foo() { } }
class A_Derived : public A_Base {
foo () { } }
class B_Base : A_Base {
bar() { foo() }
}
class B_Derived : public B_Base, A_Derived {
}
int main () {
B_base var = B_Derived();
var.bar(); // calls foo() from class A_Base and not A_Derived
}
B_base
has to heritate from A_base
.
How can I make that when calling var.bar()
, bar is called from A_Derived
and not A_Base