Team LiB
Previous Section Next Section

Part IV: Object-Oriented and Generic Programming

第四部分:面向对象编程与泛型编程

Part IV extends the discussion of Part III by covering how C++ supports object-oriented and generic programming.

第四部分 继续第三部分的讨论,涵盖 C++ 支持面向对象编程和泛型编程。Part III

Chapter 15 covers inheritance and dynamic binding. Along with data abstraction, inheritance and dynamic binding are fundamental to object-oriented programming.

第十五章讨论继承和动态绑定。继承和动态绑定与数据抽象一起成为面向对象编程(object-oriented programming)的基础。

Chapter 16 covers function and class templates. Templates let us write generic classes and functions that are independent of type.

第十六章讨论函数模板和类模板。模板使我们能够编写独立于具体类型的泛型类和泛型函数。

Writing our own object-oriented or generic types requires a fairly good understanding of C++. Fortunately, we can use OO and generic types without understanding the details of how to build them. In fact, the standard library uses the facilities we'll study in Chapters 15 and 16 extensively, and we've used the library types and algorithms without needing to know how they are implemented. Readers, therefore, should understand that Part IV covers advanced topics. Writing templates or object-oriented classes requires a good understanding of the basics of C++ and a good grasp of how to define more basic classes.

编写自己的面向对象类型或泛型类型需要对 C++ 的充分理解,幸运的是,我们可以使用面向对象和泛型类型而无需了解它们的构建细节。事实上,标准库广泛使用了将在第十五章第十六章中介绍的设施,而且我们已经在不了解实现细节的情况下使用了标准库中的类型和算法。因此,读者应该理解第四部分涵盖的是一些高级主题。编写模板或面向对象的类,需要充分理解 C++ 的基本原理并且很好地掌握怎样定义更基本的类。


CONTENTS
目录
 

Chapter 15 Object-Oriented Programming

 

第十五章 面向对象编程

 

Chapter 16 Templates and Generic Programming

 

第十六章 模板与泛型编程

Team LiB
Previous Section Next Section