Should the exception in the destructor be ignored?
应该忽略析构函数中的异常吗?
It is possible for the destructor to throw an exception.
这是可能的析构函数抛出一个异常。
If an exception occurs, the destructor cannot be called.
如果出现异常,则无法调用析构函数。
First, the destructor of the object that's being deleted is called.
首先,调用将要被删除的对象的析构函数。
If the destructor is empty, this simply results in a loss of performance.
如果析构函数为空,只会导致性能降低。
In Listing 24, the constructor of F is called before F2; likewise for the destructor.
在清单24 中,先调用F的构造函数,然后是F2 的;对于销毁函数也是这样。
When the destructor is called, the garbage collector is invoked to process the queue.
调用析构函数时,将调用垃圾回收器来处理该队列。
The programmer has no control over when the destructor is called because this is determined by the garbage collector.
程序员无法控制何时调用析构函数,因为这是由垃圾回收器决定的。
The root class of an inheritance hierarchy should define a virtual destructor even if the destructor has no work to do.
继承层次关系的根类应该定义虚函数性质的析构函数,即使这个析构函数不做任何的事情。
Put the functionality you need in separate functions called by the destructor and the copy constructor and the assignment operator.
放在单独的功能调用析构函数和拷贝构造函数和赋值运算符你所需要的功能。
If it considers an object eligible for destruction, it calls the destructor (if any) and reclaims the memory used to store the object.
如果它将物件视为符合解构资格,便会呼叫解构函式(如果存在),并且回收用来储存该物件的记忆体。
The constructor function is invoked immediately prior to main being called; and the destructor function is called when your application exits.
constructor函数是在调用main函数之前调用的,而destructor 函数则是在应用程序退出时调用的。
To manage a class with pointer members, we must define all three copy-control members: the copy constructor, assignment operator, and the destructor.
为了管理具有指针成员的类,必须定义三个复制控制成员:复制构造函数、赋值操作符和析构函数。
Calling upon the malefic pit lords and their barbarous leader, Mannoroth the Destructor, Archimonde hoped to establish a fighting elite that would scour creation of all life.
他号令罪恶的深渊领主和他们的野蛮的首领毁灭者玛诺洛斯·阿克·蒙德希望建立起能够摧毁一切生命的杰出力量。
Delay assembly was used to replace the delay disk, and the delay precision of the destructor was improved accordingly. More applications of the delay assembly in fuse were introduced.
用延期组合件代替时间药盘,提高了自毁机构的延期精度,在引信中得到更多的应用。
In the constructor function, a new trace file is opened into which the profiling address trace will be written; within the destructor function, the trace file is closed (see Listing 3).
在constructor函数中,会打开一个新的跟踪文件,分析数据的地址跟踪就是写入这个文件的;在destructor函数中,会关闭这个跟踪文件(参见清单3)。
Destructors cannot have parameters, they cannot have accessibility modifiers, and they cannot be invoked explicitly. The destructor for an instance is invoked automatically during garbage collection.
析构函数不能有参数,不能有访问级别修饰符,不能被显式调用。实例的析构函数在垃圾收集时自动调用。
The other way to say it is, never define a global (static global) instance of a class whose constructor or destructor may throw exceptions.
换一种说法就是永远都不要为那些其构造函数和析构函数可能抛出异常的类定义全局(静态全局)实例。
The constructor and destructor of the queue class are responsible for the creation and destruction of the mutex, as shown in Listing 1.
队列类的构造函数和析构函数负责创建和销毁互斥锁,见清单1。
When the handle scope's destructor is called all handles created within that scope are removed from the stack.
当句柄范围的析构函数被调用时,所有在那个范围中创建的句柄都将被从栈中移除。
Figure 1 shows a constructor with two arguments of type Point and a destructor modeled for the DrawingSurface class of the sample application used here for illustration purposes.
图1展示了为示例应用程序(在这里用于举例)的drawingsurface类建模的带有两个Point类型参数的构造方法和一个析构方法。
There are a few user space solutions to this problem, such as creating a destructor for the parent class that will release the child object directly.
有一些用户空间解决方案可以解决这个问题。例如为父类创建一个解构函数将直接释放子对象。
One key driving force behind bee destruction in Europe and North America has been a type of mite, the varroa destructor pest, which attacks bees and that beekeepers struggle to control, Neumann said.
欧洲、北美的蜜蜂面临的毁灭背后一个关键性的驱动力是一种叫做瓦螨的小虫,它们向蜜蜂发起进攻,而养蜂人则极力想要控制它们,诺依曼说。
A destructor is named in a similar manner, except that it has a ~ (tilde) followed by the parent's name.
析构方法按类似的方式命名,除了它的母体名前有一个~(否定号)。
This destructor would have to be called specifically before unsetting the parent class reference.
这种解构器必须在解除父类引用之前进行调用。
The constructor and destructor methods of this object do the necessary setup and cleanup.
这个对象的constructor和destructor方法执行必需的设置和清除工作。
To create your constructor and destructor, declare two functions, then apply the constructor and destructor function attributes to them.
要创建constructor和destructor函数,则需要声明两个函数,然后对这两个函数应用constructor和destructor函数属性。
This may cause the reference count for the object previously bound to the name to reach zero, causing the object to be deallocated and its destructor (if it has one) to be called.
这可能导致早先约束到该名字的对象的引用计数降为零,导致释放该对象的分配空间并调用其析构器,如果它有一个的话。
This may cause the reference count for the object previously bound to the name to reach zero, causing the object to be deallocated and its destructor (if it has one) to be called.
这可能导致早先约束到该名字的对象的引用计数降为零,导致释放该对象的分配空间并调用其析构器,如果它有一个的话。
应用推荐