虚拟继承的内部 [英] Internal of Virtual Inheritance

查看:80
本文介绍了虚拟继承的内部的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

任何人都可以解释虚拟继承的内部,虚拟继承实际如何工作以及运行时绑定是如何完成的?

Can anyone explain the internals of virtual inheritance,how the virtual inheritance actually works and how run time binding is done??

推荐答案

请参阅此链接,



http://www.learncpp .com / cpp-tutorial / 125-the-virtual-table / [ ^ ]



我从这个网站上学到了很多内部的东西。希望它会有所帮助。
Refer this link,

http://www.learncpp.com/cpp-tutorial/125-the-virtual-table/[^]

I have learned lot many ''internal'' sort of thing from this site. Hope it will help.


你说虚拟继承但看着你的回复,我认为你的意思是多重继承。谷歌可以帮助你(如果你给它正确的关键字),但这里 [< a href =http://www.learncpp.com/cpp-tutorial/117-multiple-inheritance/\"target =_ blanktitle =New Window> ^ ]是一篇合理的文章,解释了它。
You said virtual inheritance but looking at your response, I think you meant multiple inheritance. Google can help you out (if you give it the right keyword), but here[^] is a reasonable article that explains it.

从程序员那里,很多问题都得到了很好的回答 C ++ FQA Lite:继承 - 多重和虚拟继承



PS:编译器解决运行时解析虚函数调用问题的确切方式可能依赖于编译器,因此如果您发现编译器正在使用具有特定类层次结构的更多内存,则这可能是特定于编译器的。 (但它也可能是系统的)
From the programmers side, a lot of questions are answered very well at C++ FQA Lite: Inheritance - multiple and virtual inheritance

P.S.: the exact way how a compiler solves the problems of resolving virtual function calls at run time may depend on the compiler, so if you find that your compiler is using more memory with a specific class hierarchy, this may be compiler specific. (but it may also be systematic)


这篇关于虚拟继承的内部的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆