avatar
[转载] {rodney} Re: Hi# Programming - 葵花宝典
c*e
1
【 以下文字转载自 crystalike 的信箱 】
【 原文由 crystalike 所发表 】
basically think about how the compiler will generate code to
call the member function.
if the ptr type is of the class which has the non virtual function the compi
ler will generate the code which directly jump into the code segment of the
member function. static binding.
if the ptr tye is of the class which has the virtual function the compiler w
ill generate code to:
1. from the this pointer go the vtable.
2. from the vtable to call the appropr
avatar
yy
2
nice!
just read the similar case from Effective c++

【在 c********e 的大作中提到】
: 【 以下文字转载自 crystalike 的信箱 】
: 【 原文由 crystalike 所发表 】
: basically think about how the compiler will generate code to
: call the member function.
: if the ptr type is of the class which has the non virtual function the compi
: ler will generate the code which directly jump into the code segment of the
: member function. static binding.
: if the ptr tye is of the class which has the virtual function the compiler w
: ill generate code to:
: 1. from the this pointer go the vtable.

相关阅读
logo
联系我们隐私协议©2024 redian.news
Redian新闻
Redian.news刊载任何文章,不代表同意其说法或描述,仅为提供更多信息,也不构成任何建议。文章信息的合法性及真实性由其作者负责,与Redian.news及其运营公司无关。欢迎投稿,如发现稿件侵权,或作者不愿在本网发表文章,请版权拥有者通知本网处理。