3 ms·
Not just longjmp and goto, but Objective-C's @throw. As much as I'm a fan of RAII in C++, it really is a "pure C++" idiom. If a C++ class is needed in Objecti
by makecheck 15y ago
Not just longjmp and goto, but Objective-C's @throw.
As much as I'm a fan of RAII in C++, it really is a "pure C++" idiom. If a C++ class is needed in Objective-C code that can @throw an NSException, then the C++ cleanup code really has to be invocable explicitly (because the destructor might not be called). For example:
MyCPlusPlusObject object;
@try
{
...
}
@finally
{
object.cleanup();
}