With the polymorphism in object oriented programming language, the abstract operation is expressed by the virtual function. In this way, the designed class can be used as a reusable software component.
利用面向对象程序设计语言中的多态性等机制,将抽象操作用虚函数表示,如此设计的类可以作为可重用部件使用。
参考来源 - 算法形式化推导及其在软件重用中的应用 in C·2,447,543篇论文数据,部分数据来源于NoteExpress
以上来源于: WordNet
The code generated for the pure virtual function is shown in Listing 1.
为纯虚函数所生成的代码如列表 1 中所示。
The code generated for the virtual function in a header file is shown in Listing 2.
在头文件中为该虚函数所生成的代码如列表2中所示。
Listing 1 defines three classes (a, B and c) with a common virtual function WhoAmI .
清单1定义了三个类(A、b和c),它们有一个共同的虚函数whoami 。
应用推荐