Why does scope(success) have to use exceptions?

Andrej Mitrovic andrej.mitrovich at gmail.com
Thu Jan 17 07:35:14 PST 2013


On 1/17/13, Maxim Fomin <maxim at maxim-fomin.ru> wrote:
> In any case, your void callScope(ref int x) can be blown up by:
> int* ptr; callScope(*ptr); so, exceptions may come when they are
> not expected.

That was the point of the sample code, exceptions can be thrown at any
point and as a result the stack will unwind, hence the compiler can
rewrite callScope to look like callFunc. This isn't about the *lack*
of exceptions being thrown.


More information about the Digitalmars-d mailing list