Answering to the issue on try ... finally in C++ by Max the problem is that in this way you are not able to intercept well other kinds of eceptions.
The best way to implement the finally construct is to use a support object whose destructor is invoked on exiting the try ... catch scope. The most common case of finally code si the one relative to resource deallocation. Call-it a resource holder pattern.
Comments
The best way to implement the finally construct is to use a support object whose destructor is invoked on exiting the try ... catch scope. The most common case of finally code si the one relative to resource deallocation. Call-it a resource holder pattern.