4 ms·
I agree with your points, but the setjmp/longjmp issue is largely orthogonal to RAII. If you've got code in your library that you need to run after invoking a
by vinkelhake 13y ago
I agree with your points, but the setjmp/longjmp issue is largely orthogonal to RAII.
If you've got code in your library that you need to run after invoking a user callback (like free or mutex unlock) and the user does a longjmp on you, it doesn't really matter if the code you want executed is done automatically from a destructor (as in RAII) or manually. If you want to allow the user to do a longjmp from a callback you have to write the code carefully to handle this, be it C or C++.