“Thinking in C++”(第2版)第1卷三种文本对照学习注记

来源:互联网 发布:淘宝账号怎么改手机号 编辑:程序博客网 时间:2024/05/21 06:18

1.        引言

本文汇总了对英文原著“Thinking in C++”及其法文译本和中文译本进行对照学习时所做的注记。这三种文本是:

 

英文版:Bruce Eckel: Thinking in C++ (Second Edition), Volume One: Introduction to Standard C++, http://bruce-eckel.developpez.com/livres/cpp/ticpp/v1/

 

法文版:Pencer en C++, Date de publication : 27/08/2008 , Date de mise à jour : 27/08/2008, http://bruce-eckel.developpez.com/livres/cpp/traduction/ticpp2vol1/

 

中文版:刘宗田 袁兆山 潘秋菱 等,C++编程思想(第2版) 1卷:标准C++导引,机械工业出版社,2002.9 20093月第1版第17次印刷

 

通过对照学习,笔者感到总体来说中文版对我们初学者是有用的,能帮助我们基本理解原著的要义。但如果要精读,就不能只读中文版了

2.        注记

1

章节

0 - Preface

英文版

Throughout, I’ll be taking the attitude that you want to build a model in your head that allows you to understand the language all the way down to the bare metal.

法文版

Du début à la fin, j'adopterai l'attitude selon laquelle vous voulez construire un modèle dans votre tête qui vous permettra de comprendre le langage jusque dans ses moindres details.

中文版

我将始终坚持一种观点:读者应当在头脑中建立一个模型,以便逐步理解这种语言,直到炉火纯青的程度

注记

没有查到把“bare metal”译为“炉火纯青的程度”的依据。法译文是“较小的细节”。

 

2

章节

1.1 - The progress of abstraction

英文版

The idea is that the program is allowed to adapt itself to the lingo of the problem by adding new types of objects.

法文版

L'idée est qu'on permet au programme de s'adapter au fond du problème en ajoutant de nouveaux types d'objets.

中文版

其思想是允许程序通过添加新的对象类型,而使程序本身能够根据问题的术语进行调整。

注记

法文版把“the lingo of the problem”翻译为“问题的实质”。

 

3

章节

1.1 - The progress of abstraction

英文版

This is actually a loaded statement.

法文版

C'est une caractéristique lourde de signification.

中文版

这实际上是一条装载语句。

注记

此句拟理解为“这实际上是一种意味深长的说法”,或按法文版“这种特性具有丰富的含义”。

 

4

章节

1.3 - The hidden implementation

英文版

In any relationship it’s important to have boundaries that are respected by all parties involved.

法文版

dans chaque relation il est important de fixer des frontières respectées par toutes les parties concernées.

中文版

在任何关系中,存在一个所有的参与者都遵从的边界是重要的。

注记

法文版使用了动词fixer,即“确定边界,有主动意义。

 

5

章节

1.4 - Reusing the implementation

英文版

Composition comes with a great deal of flexibility. The member objects of your new class are usually private, making them inaccessible to the client programmers who are using the class.

法文版

La composition s'accompagne d'une grande flexibilité : les objets membres de la nouvelle classe sont généralement privés, ce qui les rend inaccessibles aux programmeurs clients de la classe.

中文版

组合具有很大的灵活性,新类的成员对象通常是私有的,使用这个类的客户程序员不能接触它们。

注记

英文版和法文版都说“组合带来很大的灵活性”。Inaccessible是不能访问。

 

6

章节

1.5 - Inheritance:reusing the interface

英文版

By itself, the idea of an object is a convenient tool. It allows you to package data and functionality together by concept

法文版

L'idée d'objet en elle-même est un outil efficace. Elle permet de fournir des données et des fonctionnalités liées entre elles par concept

中文版

对象的思想本身是一种很方便的工具。我们可以将数据和功能通过概念封装在一起

注记

“我们可以”拟改为“它允许我们”。

 

7

章节

1.5 - Inheritance:reusing the interface

英文版

This is effectively what you get with inheritance, with the exception that if the original class (called the base or super or parent class) is changed, the modified “clone” (called the derived or inherited or sub or child class) also reflects those changes.

法文版

C'est ce que l' héritagepermet de faire, avec la restriction suivante : si la classe originale (aussi appelée classe de base, superclasseou classe parent) est changée, le « clone » modifié (appelé classe dérivée, héritée, enfantou sous-classe) répercutera aussi ces changements.

中文版

这就是继承(inheritance)带来的好处,缺点是,。。。。。

注记

英文exception是例外,法文restriction是局限,都没有说是缺点。

 

8

章节

1.5 - Inheritance:reusing the interface

英文版

the methods from the base-class interface come right along into the derived class

法文版

les méthodes de l'interface de la classe de base sont importées dans la classe dérivée

中文版

来自基类接口的方法也就进入了派生类

注记

法文版和中文版都没有把“right along”翻译出来,可否理解为“直接进入了派生类”

 

9

章节

1.5 - Inheritance:reusing the interface

英文版

To override a function, you simply create a new definition for the function in the derived class.

法文版

Pour redéfinir une fonction, il suffit de créer une nouvelle définition pour la fonction dans la classe dérivée.

中文版

为了重载函数,可以简单地在派生类中创建新定义。

注记

注意原文是“override”而不是“overload”,法文版把这里的override翻译为重新定义。中文版没有译出“the function”。“simply”译为“只要”较符合原义。此句拟为“为了重载函数,只要对派生类中的函数创建新定义。”

 

10

章节

1.6 - Interchangeable objects with polymorphism

英文版

There’s a problem, however, with attempting to treat derived-type objects as their generic base types

法文版

Un problème se pose cependant en voulant traiter les types dérivés comme leur type de base générique

中文版

然而,如果试图把派生类型的对象看做是比它们自身更一般的基本类型

注记

“比它们自身更一般”令人费解,“generic”拟解释为“所属的”,此句拟为“然而,如果试图把派生类型的对象看做是它们所属的基本类型”。

 

11

章节

1.6 - Interchangeable objects with polymorphism

英文版

To perform late binding, the C++ compiler inserts a special bit of code in lieu of the absolute call.

法文版

Pour créer une association tardive, le compilateur C++ insère une portion spéciale de code en lieu et place de l'appel absolu.

中文版

为了执行晚捆绑,C++编译器在真正调用的地方插入一段特殊的二进制代码。

注记

英文“bit”与法文“portion”对应,是“段”而不是“二进制”,“a special bit of code”拟是“一段特殊的代码”。

 

12

章节

1.8 - Exception handling: dealing with errors

英文版

Ever since the beginning of programming languages, error handling has been one of the most difficult issues.

法文版

Depuis les débuts des langages de programmation, le traitement des erreurs s'est révélé l'un des problèmes les plus ardus.

中文版

从程序设计语言出现开始,错误处理就是最重要的问题之一。

注记

the most difficult issues”拟解释为“最困难的问题”。法文“ardus”意为艰难的。

 

13

章节

1.8 - Exception handling: dealing with errors

英文版

An exception is an object that is “thrown” from the site of the error and can be “caught” by an appropriate exception handler designed to handle that particular type of error.

法文

Une exception est un objet qui est « émis » depuis l'endroit où l'erreur est apparue et peut être intercepté par un gestionnaire d'exceptionconçu pour gérer ce type particulier d'erreur.

中文版

异常是一个对象,它在出错的地方被抛出,并且被一段用以处理特定类型错误的异常处理代码(exception handler)所接收。

注记

英文版和法文版都表述了异常被相应的异常处理代码捕获,中文版没有表述“相应的”这层意思,“接收”一词没有传达原义。

 

14

章节

1.9 - Analysis and design

英文版

The object-oriented paradigm is a new and different way of thinking about programming and many folks have trouble at first knowing how to approach an OOP project.

法文版

Le paradigme de la POO constitue une approche nouvelle et différente de la programmation et beaucoup de personnes rencontrent des difficultés pour appréhender leur premier projet orienté objet.

中文版

面向对象范例是一种新的异于前辈的编程思考方式,许多人一开始在学习如何处理一个OOP项目时都会感到非常困难。

注记

paradigm”拟译为“范式”,英文版和法文版中没有出现与“前辈”对应的词。

 

15

章节

1.9 - Analysis and design

英文版

The class of programming problem discussed in this chapter is of the “wild-card” (my term) variety

法文版

Les problèmes traités dans ce chapitre font partie de la classe de problèmes « joker » (invention personnelle)

中文版

本章讨论的编程问题属于所谓“不定(wild-card)”(本人的术语)类型

注记

wild-card”和“joker”均指纸牌中的百搭。

 

16

章节

1.9 - Analysis and design

英文版

1 What are the objects?

法文版

1 Quels sont les objets ?

中文版

1)什么是对象?

注记

“什么是对象?”使人感觉在问对象的定义,此处实际是问在项目中有哪些对象。

 

17

章节

1.9.2 - Phase 1: What are we making?

英文版

“Here’s a description of what the program will do (not how) to satisfy the requirements.”

法文版

« une description de ce que le programme fera (sans ce préoccuper du comment) pour satisfaire les besoins »

中文版

“这是程序将做什么(不是现在)以满足需求的一个描述”

注记

not how” 拟译为“不是如何做”。

 

18

章节

1.9.4 - Phase 3: Build the core

英文版

stakeholders

法文版

clients

中文版

风险承担者

注记

stakeholder译为利益相关者”、“持股人”等,实际上一般是指“客户”(如法译文)。

 

19

章节

2.1.2 - Compilers

英文版

The transition from writing code to executing code is significantly longer with a compiler.

法文版

La transition entre l'écriture du code et son exécution est significativement plus

longue avec un compilateur.

中文版

使用编译器,从写源代码到执行代码的转换是一个较长的过程。

注记

拟理解为“使用编译器时,从写源代码转到执行代码是一个较长的过程。”

 

20

章节

2.1.2 - Compilers

英文版

separate compilation

法文版

Compilation séparée

中文版

分段编译

注记

“段指什么?还是称“分别编译”为妥。

 

21

章节

2.2 - Tools for separate compilation

英文版

In C and C++, a program can be created in small, manageable, independently tested pieces.

法文版

En C et C++, un programme peut être créé par petits morceaux maniables, testés indépendamment.

中文版

C/C++中,可以将一个大程序构造成为许多小程序块,而这些小程序块容易管理,可以独立调试。

注记

Test对应测试,debugging对应调试。

 

22

章节

2.2 - Tools for separate compilation

英文版

When you call a function, you typically pass it some arguments, which are values you’d like the function to work with during its execution.

法文版

Quand vous appelez une fonction, vous lui passez typiquement des arguments, qui sont des valeurs que la fonction utilise pendant son exécution.

中文版

当调用函数时,通常要传给它一些参数(argument)。这些参数是一些值,我们希望用这些值来执行函数。

注记

拟理解为“这些参数是我们希望函数在执行时使用的值”。

 

23

章节

Including headers (中文版2.2.1.5

英文版

“implementation-defined way.”

法文版

"d'une manière définie par l'implémentation."

中文版

“定义实现的途径”

注记

法译文很清楚,是“由实现定义的方式”。

 

24

章节

Including headers (中文版2.2.1.5

英文版

The preprocessor will find the iostream header file (often in a subdirectory called “include”) and insert it.

法文版

Le préprocesseur trouvera le fichier d'en-tête iostream (souvent dans un sous-répertoire appelé "include") et l'insérera.

中文版

预处理器会找到iostream头文件(通常在“include”子目录下)并把它插入头文件所在位置。

注记

拟理解为“插入include语句所在位置”。

 

25

章节

2.2.3 - Using libraries

英文版

“unresolved references.”

法文版

"références non résolues".

中文版

“未解析的引用”

注记

此时连接器已经开始解析,但还没有找到定义,因此是“未解决的引用”,这样与下文也一致了。

 

26

章节

2.2.3 - Using libraries

英文版

Libraries have some sort of indexing

法文版

Les bibliothèques ont une sorte d'index

中文版

库有多种索引方式

注记

英文版和法文版都说是某种索引方式,即只有一种而不是多种。

 

27

章节

2.3.4 - "Hello, world!"

英文版

the last line of the listing will end with a comment followed by ‘/:~

法文版

la dernière ligne du listing se terminera avec un commentaire suivi par " /:~"

中文版

最后一行是以“/~”开始的注释

注记

/~”要在最后一行注释的结尾而不是开始,否则就非法了。

 

28

章节

2.5 - Introducing strings

英文版

you don’t have to worry about what happens to the previous contents – that’s handled automatically for you

法文版

vous n'avez pas à vous inquiéter de ce qui arrive au contenu précédent - c'est géré automatiquement pour vous

中文版

不必为先前的内容费心,它将做自动处理。

注记

拟解释为“它被自动处理了”。

 

29

章节

2.7 - Introducing vector

英文版

However, this control expression is in three parts: a part which initializes, one that tests to see if we should exit the loop, and one that changes something, typically to step through a sequence of items.

法文版

Cependant, cette expression de contrôle est en trois parties : une partie qui initialise, une qui teste si l'on doit sortir de la boucle, et une qui change quelque chose, typiquement pour itérer sur une séquence d'éléments.

中文版

控制表达式,由三部分组成:第一部分初始化;第二部分检测退出循环的条件;第三部分是改变控制分步通过一系列项目的某个值。

注记

第三部分拟解释为“改变某些事情,通常是遍历一个数据项序列。”

 

30

章节

3.1 - Creating functions

英文版

Pre-Standard C programmers just adapted to it.

法文版

Les programmeurs en C pré-standard s'y adaptaient.

中文版

以标准C前的程序员只能去适应这种情况。

注记

拟解释为“在C标准化之前程序员只能去适应这种情况。”

 

31

章节

.2.3 - while

英文版

In these cases, the programmer has written the conditional expression not only to perform the test but also to do the work.

法文版

Dans un tel cas, le programmeur a écrit l'expression conditionnelle pour non seulement réaliser le test mais aussi pour faire le boulot.

中文版

在这样的情况下,程序员写出了不但执行测试也可以进行自己工作的条件表达式。

注记

拟解释为“程序员写的条件表达式既实现了循环条件测试又实现了循环”。

 

32

章节

3.2.4 - do-while

英文版

For some reason, most programmers tend to avoid do-while and just work with while.

法文版

Pour des raisons diverses, la plupart des programmeurs tend à éviter l'utilisation du do-while et travaille simplement avec un while.

中文版

因为某种原因,大多数程序员更喜欢只使用while句而避免使用do-while句。

注记

法文中raisons是复数,因此是“某些原因”或“各种原因”。

 

33

章节

3.2.8 - Using and misusing goto

英文版

Using goto is often dismissed as poor programming style, and most of the time it is.

法文版

Utiliser gotodénote souvent un style de programmation pauvre, et ca l'est réellement la plupart du temps.

中文版

goto是一种不好的编程方式,经常避免使用goto,在多数情况下的确如此。

注记

按法文拟解释为“使用goto显现了一种不好的编程方式,在多数情况下的确如此。”

 

34

章节

3.2.9 - Recursion

英文版

Recursion is an interesting and sometimes useful programming technique whereby you call the function that you’re in.

法文版

La récursion une technique de programmation interressante et quelque fois utile par laquelle vous appelez la fonction dans laquelle vous êtes.

中文版

递归是十分有趣的,有时也是非常有用的编程技巧,凭借递归可以调用我们所在的函数。

注记

拟理解为“凭借递归我们可以在一个函数内部再调用这个函数”。

 

35

章节

3.4.1 - Basic built-in types

英文版

built-in types

法文版

Types intégrés

中文版

内部类型

注记

中文版有时也把built-in type译为内置类型,这比内部类型更确切一些。

 

36

章节

3.4.3 - Specifiers

英文版

so it can store positive numbers twice as large as the positive numbers that can be stored in a signed number

法文版

il peut ainsi stocker des nombres positifs deux fois plus grands que les nombres

positifs qui peuvent être stockés dans un nombre signed

中文版

所以它能存储比signed数大两倍的正数

注记

应是大一倍。

 

37

章节

3.4.3 - Specifiers

英文版

the only thing that must be consistent is that each different type hold the minimum and maximum values specified in the Standard.

法文版

la seule condition qui doit être respectée est que chaque type puisse stocker

les valeurs minimales et maximales spécifiées dans le standard

中文版

因为标准中规定每一种不同类型的最大值和最小值必须是一致的。

注记

最大值和最小值怎么一致?拟解释为“唯一要遵守的条件是各种类型具有标准中所规定的最大值和最小值”。

 

38

章节

3.10.1 - Defining a function pointer

英文版

This right-left-right motion works with most declarations.

法文版

Ce mouvement droite-gauche-droite fonctionne avec la plupart des déclarations.

中文版

大多数声明都是以左--左动作的方式工作的。

注记

应是“右--右”。

 

39

章节

4.7.5 - Namespaces in headers

英文版

(at least, not outside of a scope)

法文版

(du moins en dehors de toute portée)

中文版

(至少,不在一个范围之外)

注记

scope应译为作用域,可与书中其它地方保持一致。

 

40

章节

5.4 - Object layout

英文版

Object layout

法文版

organisation physique d'un object

中文版

对象布局

注记

法文版把Object layout”翻译为“对象的物理结构”。

 

41

章节

5.5 - The class

英文版

the creation of new data types that are more than just C structs with functions

法文版

la création de nouveaux types de données qui sont plus que des structs C avec des fonctions

中文版

新的数据类型并非只是C中的带有函数的struct

注记

C中的struct不能带有函数。拟解释为“新的数据类型并非只是C中的struct加上函数”。

 

42

章节

5.5 - The class

英文版

The shift to classes is so important

法文版

Le changement avec les classes

中文版

转换到类是如此重要

注记

此处shift拟解释为转变,或按法文版理解为“类带来的改变”。

 

43

章节

6 - Initialization & Cleanup

英文版

Two of these safety issues are initialization and cleanup.

法文版

Deux de ces questions de sûreté sont l'initialisation et le nettoyage.

中文版

安全性包括初始化和清除两个方面。

注记

应是安全性问题。

 

44

章节

6.3 - Elimination of the definition block

英文版

(This is a stylistic suggestion for built-in types, where initialization is optional.)

法文版

(Ceci est une suggestion de style pour les types intégrés, pour lesquels l'initialisation est optionnelle).

中文版

(这是对内部类型的一种格式上的建议,但在那里可以不做初始化)。

注记

拟理解为“(这是对内置类型的一种格式上的建议,而内置类型变量的初始化实际是可选的)。”

 

45

章节

6.6 - Aggregate initialization

英文版

aggregate

法文版

aggrégat

中文版

集合

注记

aggregate拟译为聚合,以区别于set

 

46

章节

6.6 - Aggregate initialization

英文版

off-by-one error

法文版

d'erreur de bord

中文版

“偏移一位”

注记

拟译为“差一错误”,法文版译为“边界错误”比较容易理解。

 

47

章节

7.1.2 - Type-safe linkage

英文版

When the linker tries to resolve the reference to f_char

法文版

Quand l'éditeur de liens essaye de trouver la référence à f_char

中文版

当连接器试图引用f_char

注记

拟译为“当连接器试图找到f_char的引用时”。

 

48

章节

8.1 - Value substitution

英文版

C++ uses const to eliminate these problems by bringing value substitution into the domain of the compiler.

法文版

C++ emploie const pour éliminer ces problèmes en déplaçant la substitution de valeur dans le domaine du compilateur.

中文版

C++const把值替代带进编译器领域来消除这些问题。

注记

拟理解为“C++const来消除这些问题的方法是把值替代移交给编译器”,而以前值替代是预处理器执行的。

 

49

章节

8.1.3 - Aggregates

英文版

but you’re virtually assured that the compiler will not be sophisticated enough to keep an aggregate in its symbol table

法文版

mais vous êtes pratiquement assurés que le compilateur ne sera pas assez sophistiqué pour maintenir un agrégat dans sa table de symbole

中文版

但必须保证编译器不会复杂到把一个集合保存到它的符号表中

注记

拟理解为“你要相信编译器不会真的把一个集合保存到它的符号表中”。

 

50

章节

8.2.3 - Assignment and type checking

英文版

The place where strict constness is not enforced is with character array literals.

法文版

Le cas où la constance stricte n'est pas imposée, est le cas des tableaux de caractères littéraux.

中文版

限定词const是很严格的,没有强调const的地方是字符数组的字面值。

注记

拟解释为“没有强调严格的const性的地方是字符数组的字面值。”

 

51

章节

9.2.2 - Access functions

英文版

how you call the function determines whether you’re reading or modifying state information

法文版

la façon dont vous appelez la fonction détermine si vous lisez ou modifiez l'état de l'information

中文版

如何调用函数来决定是读还是修改状态信息。

注记

按法文版拟解释为“函数的调用方式决定是读还是修改状态信息。”

 

52

章节

10.2.1 - Creating a namespace

英文版

A namespace definition can be “continued” over multiple header files using a syntax that, for a class, would appear to be a redefinition:

法文版

La définition d'un espace de nommage peut être “continuée” sur plusieurs fichiers d'en-tête en utilisant une syntaxe qui, pour une classe, ressemblerait à une redéfinition

中文版

一个namespace可以在多个头文件中用一个标识符来定义,就好象重复定义一个类一样

注记

拟解释为“可以按类的语法定义一个namespace,定义的内容可在多个头文件中延续,看上去象是在重复定义这个namespace。”

 

53

章节

12.5 - Overloading assignment

英文版

It’s even better to avoid writing code that uses the = for initialization; instead, always use the explicit constructor form.

法文版

Il est même préférable d'éviter d'écrire du code qui utilise le =pour l'initialisation ; au lieu de cela, utilisez toujours la forme explicite du constructeur.

中文版

对于初始化,使用“=”可以避免写代码,不用总是用显式的构造函数形式。

注记

中文版把原意译反了,应是“最好避免编写使用‘=’的初始化代码,而是用显式的构造函数形式。”

 

54

章节

12.6.4 - Pitfalls in automatic type conversion

英文版

so it will generate an ambiguity error when that conversion occurs

法文版

donc il va générer une erreur d'ambiguité quand cette conversion se produit

中文版

所以当发生转换时,编译器会产生一个不明确指示的出错信息。

注记

拟理解为出错信息的内容是“ambiguous conversion(二义的转换)”。

 

55

章节

12.6.4 - Pitfalls in automatic type conversion

英文版

A more difficult problem to spot occurs

法文版

Un problème plus difficile à résoudre apparait

中文版

会发生一个引起出错的更困难的问题

注记

拟理解为“会发生一个更难解决的问题”。

 

56

章节

13.4 - Running out of storage

英文版

The behavior of the new-handler is tied to operator new( ),

法文版

Le comportement du gestionnaire de 'new' est lié à operator new ( )

中文版

new-handler试着调用operator new( )

注记

应是“new-handler 的行为与operator new( )绑在一起”。

 

57

章节

14.4 - Combining composition & inheritance

英文版

It’s worth emphasizing that constructors and destructors are quite unusual in that every one in the hierarchy is called

法文版

Il est important d'insister sur le fait que les constructeurs et les destructeurs sont tout à fait inhabituels en cela en cela que chacun dans la hiérarchie est appelé

中文版

重点要注意构造函数和析构函数与众不同之处在于每一层函数都被调用

注记

拟理解为,构造函数和析构函数在每一层中它们都被调用。

 

58

章节

14.4 - Combining composition & inheritance

英文版

If you also want to call the base-class version of a normal member function that you’re overriding

法文版

Si vous voulez appeler aussi la version de la classe de base d'une fonction membre normale que vous surchargez

中文版

如果还想调用重新定义过的成员函数的基类版本

注记

14.5中专门定义了redifiningoverriding,因此这里的意思肯定不是重新定义法文版把这里的overriding改为重载。看来原文应该用overloading而不是overriding

 

59

章节

15.1 - Evolution of C++ programmers

英文版

As a procedural programmer, you have no referent with which to think about virtual functions, as you do with almost every other feature in the language.

法文版

Comme programmeur procédural, vous n'avez aucune référence à laquelle vous ramener pour penser aux fonctions virtuelles, contrairement à pratiquement toutes les autres caractéristiques du langage.

中文版

作为一个过程型程序员,没有什么事物可以帮助他思考虚函数,因为他接触的是这个语言的其他特征。

注记

拟理解为“作为一个过程型程序员,没有什么事物可以帮助他思考虚函数,这不同于他在接触这个语言的其它大部分特征时还有参照。”

 

60

章节

15.10 - virtual functions & constructors

英文版

the preprocessor has no concept of access or classes

法文版

le préprocesseur ne dispose pas des concepts d'accès ou de classes

中文版

预处理器没有通道或类的概念

注记

Access应是访问。

 

61

章节

15.10.2 - Behavior of virtual functions inside constructors

英文版

The constructor code is completely ignorant of whether or not the object is in the base of another class.

法文版

Le code du constructeur est incapable de savoir si l'objet est à la base d'une autre classe ou pas.

中文版

它完全忽视这个对象是否是基于其他类的。

注记

Ignorant应是无知的,即“它完全不知道这个对象是否是基于其它类的。”

 

62

章节

15.11 - Destructors and virtual destructors

英文版

while delete b2p calls the derived-class destructor followed by the base-class destructor

法文版

alors que delete b2p appelle le destructeur de la classe dérivée suivi par le destucteur de la classe de base,

中文版

而当delete b2p调用时,在基类的析构函数执行后,派生类析构函数将会执行,

注记

应是“delete b2p调用派生类析构函数后,然后调用基类的析构函数”。

 

63

章节

15.13 - Downcasting

英文版

explicit cast

法文版

transtypage explicite

中文版

显示类型转换

注记

应是“显式类型转换”。

 

64

章节

15.13 - Downcasting

英文版

Here, the base class contains a virtual destructor and that suffices.

法文版

Ici, la classe de base contient un destructeur virtuel et cela suffit.

中文版

这里,基类含有一个虚析构函数并定义了它。

注记

拟解释为“基类含有一个虚析构函数,这足够了。”

 

65

章节

16 - Introduction to Templates

英文版

Although containers are ideal examples for use with templates

法文版

Bien que les conteneurs soient des exemples idéaux pour l'utilisation des templates

中文版

虽然容器是与模板一起使用的理想的例子

注记

拟解释为“虽然容器是模板使用的理想的例子”。

 

66

章节

16.2.1 - The template solution

英文版

instead of worrying about inheritance or composition when you want to use a container class

法文版

au lieu d'voir à s'inquiéter d'héritage ou de composition quand vous voulez utiliser une classe de conteneur

中文版

可以不必为使用容器类时的继承和组合担忧了

注记

拟解释为“不必在使用容器类时担忧继承或组合了”。

 

原创粉丝点击