3 ms·
It's not only C++ that has problems with throws out of destructors or similar logic. How about Common Lisp: http://clhs.lisp.se/Issues/iss152_w.htm http://clhs
by kazinator 12y ago
It's not only C++ that has problems with throws out of destructors or similar logic. How about Common Lisp:
http://clhs.lisp.se/Issues/iss152_w.htm http://clhs.lisp.se/Issues/iss152_w.htm
"The ambiguity at issue arises for the case where there are transfers of control from the cleanup clauses of an UNWIND-PROTECT. ..."
It is not clear what exit points are visible when the cleanup-forms (morally similar to C++ destructor calls) are invoked. Are the exit points that are skipped torn down all the way to the control transfer's target, or is the tear-down interleaved with the unwinding.
- blt 12y agoThe real answer, as far as I can tell, is "Don't use exceptions in a program that's too important to crash."
- kazinator 12y agoRight, and to that end, don't use a CPU that traps illegal instructions, divisions by zero, pointers to unmapped pages and so on. Those are all forms of exceptions.