草庐IT

c++ - 什么是多重虚拟继承?

classfoo:publicvirtualbar,publicvirtualkung{//implementationofthemethodoftheaboveinheritedclass};bar和kung类是一个抽象类,包含在foo类中实现的纯虚方法。这个有什么用? 最佳答案 在你的情况下,如果bar和kung是最派生的基类,只要bar和kung中没有方法冲突,你就会知道它,即编译器在模糊定义中的错误。有关此内容的更多信息,请访问c++常见问题解答:http://www.parashift.com/c++-faq-lite/m