No. Examples of resource deallocation primitives include overloads of operator delete, closing files, unlocking semaphores, and so on. Because these are commonly called from destructors, they should signal failure by some means other than throwing an exception. The alternatives range from printing a diagnostic error message in a log file to halting the system, and the best choice depends on the circumstances. This reduces the number of cases in which terminate() is inadvertently called. |