析构函数 destructor ; Finalize ; destructor function
构造函数和析构函数 Constructor and Destructor ; Construction and destruction
定义纯虚析构函数 pure virtual destructor
析构函数的异常 Exceptions in Destructors
析构函数、析构器 destructor
析构函数次序 destructor order
析构函数和 finalize
异常和析构函数 exception and destructor
析构函数声明 destructor-declaration
对于实现了析构函数释放非内存资源的对象来说,这是最常见的问题。
This is mostly a problem with objects that implement a destructor to free non-memory resources.
因此,也可以在析构函数中安全地使用断言。
Thus, the assertions can be used safely in destructors, too.
那些支持析构函数或垃圾收集器的语言通过在C接口上作一层封装有助于降低这个问题发生的概率。
Programming languages that support destructors or have a garbage collector may mitigate this problem by making a wrapper over the C interface.
应用推荐