Stephan Bergmann wrote: >>By default, the guard catches and ignores all exceptions being thrown >>by the functor in its destructor (but OSL_ asserts them). >>This is defensive behaviour, because exceptions being thrown in >>destructors during stack unwinding will lead to terminate()! >>Nevertheless, if you want to allow exceptions (for good reason), you >>can switch this: >> >>ScopeGuard guard( <functor>, ScopeGuard::ALLOW_EXCEPTIONS ); > > > *Would* there be good reason to do so?
IMO it may be useful if a function has multiple exit branches (return statements), but its (inner) code does not throw exceptions. I admit, this is rather exotic, so you generally *should* not use it. --Daniel --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
