R
Rahul
Hi Everyone,
I have the following class hierarchy,
A
B C
D
B and C are derived from A and D is derived from B and C. Now in
order to avoid the duplication problem, virtual inheritance can be
used. But i'm not sure as to where it should be used?
Should B and C inherit A virtually or should D inherit virtually B
and C?
I'm confused as i'm dealing with a case where A, B and C are provided
by different vendors. B knows that it has to inherit from A but is not
aware about anything else, so is the case with C.
Now how does the vendor providing class D solve the duplication
problem?
Thanks in advance ! ! !
I have the following class hierarchy,
A
B C
D
B and C are derived from A and D is derived from B and C. Now in
order to avoid the duplication problem, virtual inheritance can be
used. But i'm not sure as to where it should be used?
Should B and C inherit A virtually or should D inherit virtually B
and C?
I'm confused as i'm dealing with a case where A, B and C are provided
by different vendors. B knows that it has to inherit from A but is not
aware about anything else, so is the case with C.
Now how does the vendor providing class D solve the duplication
problem?
Thanks in advance ! ! !