因此,也可以在析构函数中安全地使用断言。
Thus, the assertions can be used safely in destructors, too.
这是可能的析构函数抛出一个异常。
我们还需要添加一个析构函数的类。
对错误类型的析构函数进行了调用。
一个类只能有一个析构函数。
如果析构函数为空,只会导致性能降低。
If the destructor is empty, this simply results in a loss of performance.
首先,调用将要被删除的对象的析构函数。
First, the destructor of the object that's being deleted is called.
尽管析构函数是一种方法,但它不能有参数。
Although a destructor is a method, it cannot have parameters.
当函数结束的时候,对象的析构函数就会被调用。
When the function end, the constructor of the object will be called.
例如,无法在析构函数或终结器上请求一个新的槽。
For example, a new slot cannot be requested on a destructor or finalizer.
构造函数和析构函数是面向对象程序设计中的难点。
The construction function and the destruction function are difficult parts in object-oriented programming design.
因此,从第一个例子不同,我们需要实现一个析构函数。
So, different from the first example, we need to implement a destructor.
因此,从第一个例子不同,我们需要实现一个析构函数。
So, different from the first example, we need to implement a destructor.
应用推荐