3 ms·
The nice thing about exceptions beyond setjmp/lngjmp (in C++ at least) is the destructor semantics which you can use to guarantee that resources are cleaned up
by LogicHoleFlaw 18y ago
The nice thing about exceptions beyond setjmp/lngjmp (in C++ at least) is the destructor semantics which you can use to guarantee that resources are cleaned up on error. There are better ways to handle such things, such as scoped resource allocation, but exceptions do an ok job.
- qwph 18y agoYou can actually use setjmp()/longjmp() to implement that kind of thing, it turns out. Here's but one example: http://www.on-time.com/ddj0011.htm http://www.on-time.com/ddj0011.htm I'm almost tempted to make an analogy with scheme's (call-with-current-continuation) here, but I think that might be pushing it.