Is there a favored idiom for mimicing Java's try/finally in C++?
Been doing Java for number of years so haven't been tracking C++. Has finally clause been added to C++ exception handling in the language definition? Is there a favored idiom that mimics Java's try/finally? Am also bothered that C++ doesn't have an ultimate super type for all possible exceptions that could be thrown - like Java's Throwable class. I can write: try { // do something } catch(...) { // alas, can't examine the exception // can only do cleanup code and perhaps rethrow, ala: throw; } ADDENDUM EDIT: I ended up accepting the answer that had the most up votes, i.e., use destructors to