1. name mangling
代码如下:
查看函数的新名,
2. Virtual table
There are three possibilities:
1. It can inherit the instance of the virtual function declared within the base class. Literally, the address of that instance is copied into the associated slot in the derived class's virtual table.
2. It can override the instance with one of its own. In this case, the address of its instance is placed within the associated slot.
3. It can introduce a new virtual function not present in the base class. In this case, the virtual table is grown by a slot and the address of the function is placed within that slot.
So if we have the expression
ptr->z();
how do we know enough at compile time to set up the virtual function call?
In general, we don't know the exact type of the object ptr addresses at each invocation of z(). We do know, however, that through ptr we can access the virtual table associated with the object's class.
Although we again, in general, don't know which instance of z() to invoke, we know that each instance's address is contained in slot 4.
This information allows the compiler to internally transform the call into
( *ptr->vptr[ 4 ] )( ptr );
分享到:
相关推荐
C++程序设计:第七讲-类与对象(ch4).pdf
C++程序设计:第五讲类与对象(ch4)引用部分.pdf
面向对象程序设计(C++)ch4---继承.ppt
Dale Rogerson写的Inside COM是COM(组件对象模型)的唯一经典书籍,Inside COM这本书是我最喜爱的书,也是启蒙我的书,用词幽默简单,这本书可以让程序员建立起大强的软件模型的观念,透过研究COM其实可以更清楚了解...
为给煤层气中甲烷与氮气的变压吸附分离提供相关的模型和热力学数据,采用静态体积法测试了温度298.15、313.15、328.15 K时,CH4/N2在自制炭分子筛上的吸附量,使用Langmuir等9个吸附模型对吸附量进行了非线性拟合,通过...
C++程序设计课件 第四章 函数与预处理,介绍函数、递归等。
chemkin燃烧分析必备, CH4燃烧机理
C++程序设计教学课件:ch4 Functions.pdf
根据实测的4个不同煤阶煤的等温吸附实验数据,采用Dubinin建立的计算吸附空间的经验公式,分别计算了13CH4与12CH4在4个煤样的吸附势及其吸附空间,建立了煤吸附甲烷特性曲线的定量表达式.结果发现,13CH4在煤表面的吸附...
CH4 局域网CH4 局域网CH4 局域网CH4 局域网CH4 局域网
运用广义梯度密度泛函理论方法(density functional theory,DFT),结合周期性平板模型,研究了CH4在Fe(111)面上的解离。计算结果表明,在Fe(111)面上,CH4的第一步解离是反应的决速步,其活化能垒约为1.02eV,比Ni(111)面上...
ch4傅里叶变换PPT学习教案.pptx
C++程序设计:第一讲ch4计算机结构 .pdf
测定了253~333K下CH4和N2纯组分在炭分子筛颗粒上的吸附动力学数据及CH4和N2纯组分及其混合体系333K下在炭分子筛固定床上的穿透曲线,选择Fick扩散模型对数据进行了模拟。结果表明:吸附初期N2的扩散系数大于CH4,此时...
STM32F103C8T6单片机通过TIM2-CH4实现PWM控制输出,可以随意调节频率和占空比。
综述了在高压条件下CO2置换CH4过程中煤岩特性变化的试验及模型等方面的研究进展,分析注入CO2后煤岩特性变化对煤岩结构、渗透率及CH4产量的影响,指出我国深部煤层CO2置换CH4过程中煤岩特性变化的研究方向.分析表明,...
为了探讨温度、压力、扩散路径等因素对原煤CH4扩散特性的影响,采用规则块样结合气相色谱法进行不同温度、压力条件下方向性原煤CH4扩散实验。实验结果表明:原煤中CH4扩散速率较小,扩散系数大小处于10-8数量级上;原煤...
C++ Builder与Windows API经典范例\配盘范例\C++ Builder与Windows API经典范例_Ch4_Keyboard Input Functions.rar
CH4 数据库建模(E-R模型)
以Van Der Waals力作用半径为边界条件,构建了煤大分子骨架模型及煤对CH4吸附的量子动力学模型;采用量子化学DFT方法,在6-311G++基组上对煤大分子骨架模型及煤对CH4分子吸附模型结构进行了优化,得到了多种吸附平衡态的...