• 管理构造函数和析构函数中的异常

    Managing exceptions in constructors and destructors

    youdao

  • 因此,也可以在析构函数中安全地使用断言。

    Thus, the assertions can be used safely in destructors, too.

    youdao

  • 这是可能的析构函数抛出一个异常。

    It is possible for the destructor to throw an exception.

    youdao

  • 应该忽略析构函数中的异常吗?

    Should the exception in the destructor be ignored?

    youdao

  • 我们还需要添加一个析构函数的类。

    We also need to add a destructor to the class.

    youdao

  • 栈展开期间会经常执行析构函数。

    Destructors are often executed during stack unwinding.

    youdao

  • 因为它没有一个析构函数。

    Because it does not have a destructor.

    youdao

  • 另外析构函数也不仅仅是用来释放资源。

    A destructor is not limited only to relinquishing resources.

    youdao

  • 首先,调用将要被删除的对象的析构函数。

    First, the destructor of the object that's being deleted is called.

    youdao

  • 只能对类使用析构函数。

    They are only used with classes.

    youdao

  • 不应使用空析构函数。

    Empty destructors should not be used.

    youdao

  • 允许定义一个析构函数当对像崩溃的时候运行。

    Allows defining a destructor function that runs when an object is destroyed.

    youdao

  • 当函数结束的时候,对象的析构函数就会被调用。

    When the function end, the constructor of the object will be called.

    youdao

  • 构造函数和析构函数是面向对象程序设计中的难点。

    The construction function and the destruction function are difficult parts in object-oriented programming design.

    youdao

  • 队列类的构造函数和析构函数负责创建和销毁互斥锁,见清单1。

    The constructor and destructor of the queue class are responsible for the creation and destruction of the mutex, as shown in Listing 1.

    youdao

  • 如果容器是保存的对象,则在容器析构的时候会自动清理这些对象。

    If the container stores objects, then it is automatically cleaned up during container destruction.

    youdao

  • 因此,从第一个例子不同,我们需要实现一个析构函数。

    So, different from the first example, we need to implement a destructor.

    youdao

  • 析构方法按类似的方式命名,除了它的母体名前有一个~(否定号)。

    A destructor is named in a similar manner, except that it has a ~ (tilde) followed by the parent's name.

    youdao

  • 对于实现了析构函数释放非内存资源的对象来说,这是最常见的问题。

    This is mostly a problem with objects that implement a destructor to free non-memory resources.

    youdao

  • 与析构函数不同,构造函数内部所做的事情经常会抛出异常。

    Unlike destructors, it is often the case that something done inside a constructor might throw an exception.

    youdao

  • 没有注意到的是,对象的析构函数调用后会引起很大的麻烦。

    No pay attention to this, the situation in which only the object destructor is called can make great deal of troubles.

    youdao

  • 尽管调用了析构函数,但是未调用数组中各个对象的构造函数。

    The constructors for the individual objects in the array are not invoked, although the destructors are.

    youdao

  • 程序员无法控制何时调用析构函数,因为这是由垃圾回收器决定的。

    The programmer has no control over when the destructor is called because this is determined by the garbage collector.

    youdao

  • 当句柄范围的析构函数被调用时,所有在那个范围中创建的句柄都将被从栈中移除。

    When the handle scope's destructor is called all handles created within that scope are removed from the stack.

    youdao

  • 当句柄范围的析构函数被调用时,所有在那个范围中创建的句柄都将被从栈中移除。

    When the handle scope's destructor is called all handles created within that scope are removed from the stack.

    youdao

$firstVoiceSent
- 来自原声例句
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定
小调查
请问您想要如何调整此模块?

感谢您的反馈,我们会尽快进行适当修改!
进来说说原因吧 确定