scope() statements and return

Ola Fosheim Grostad via Digitalmars-d digitalmars-d at puremagic.com
Fri Oct 3 21:54:38 PDT 2014


On Saturday, 4 October 2014 at 04:29:06 UTC, ketmar via 
Digitalmars-d wrote:
>> It is tricky if the throw implies that the caller to the 
>> cleanup should retry because of a timeout/deadlock
> it shouldn't. exception during cleanup means "oh, i can't! i
> really-really-really can't!", not "ok, i'm busy, try again 
> later."

Should or should not, you have to make do with what you get from 
libraries. Network being temporarily unavailable is a good reason 
to throw when freeing a networked resource...

Exceptions are made for recovery/retry/rollback.

> if some badly designed API does that -- write a wrapper.

So you need semantic analysis to ensure nothrow.



More information about the Digitalmars-d mailing list