Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

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

"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.



The real answer, as far as I can tell, is "Don't use exceptions in a program that's too important to crash."


Right, 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.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: