由买买提看人间百态

boards

本页内容为未名空间相应帖子的节选和存档,一周内的贴子最多显示50字,超过一周显示500字 访问原贴
Programming版 - [转载] {rodney} Re: Hi
相关主题
[转载] KEY mapone question about operator delete
[合集] singleton and static经典C++问题求助
[合集] some interview questions i met and remembered问个面试问题,请教
[合集] 简单问题一个:为什么可以间接访问私有指针成员C++小插曲
[合集] C++ template questionC++ 请教: about the memory layout of the class inheritance
c++ define 一问问题:vptr/vtable for virtual function & vptr/vtable for
C++声明细问C++问题几个
How to check the virtual function table size?A C++ puzzle for me
相关话题的讨论汇总
话题: hi话题: function话题: generate话题: crystalike话题: rodney
进入Programming版参与讨论
1 (共1页)
c********e
发帖数: 383
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
yy
发帖数: 45
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.

1 (共1页)
进入Programming版参与讨论
相关主题
A C++ puzzle for me[合集] C++ template question
问一个empty class的size的问题c++ define 一问
码工试题 (转载)C++声明细问
A C++ compiler related interview questionHow to check the virtual function table size?
[转载] KEY mapone question about operator delete
[合集] singleton and static经典C++问题求助
[合集] some interview questions i met and remembered问个面试问题,请教
[合集] 简单问题一个:为什么可以间接访问私有指针成员C++小插曲
相关话题的讨论汇总
话题: hi话题: function话题: generate话题: crystalike话题: rodney