阅读背景:

钻石继承和纯虚函数

来源:互联网 

Imagine a standard diamond inheritance. Class A defines pure virtual function fx, class B defines implementation for fx, classes C and D do nothing with fx. When trying to call fx on instance of class D you'll get 'ambiguous function call' error although there is only one implementation of fx. This can be solved by B and C inheriting from A in virtual manner. Is it a Imagine a standard diamond inheritance. Class A




你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: