为纯虚函数所生成的代码如列表 1 中所示。
The code generated for the pure virtual function is shown in Listing 1.
在头文件中为该虚函数所生成的代码如列表2中所示。
The code generated for the virtual function in a header file is shown in Listing 2.
当然,如果类层次结构发生变化,并且出现另外的目标方法,则JIT编译器可以更正最初生成的代码以便执行虚调用。
Of course, if the class hierarchy changes and a second target method becomes possible, then the JIT compiler can correct the originally generated code so that the virtual invocation is performed.
应用推荐