Idea: norecover blocks

dsimcha dsimcha at yahoo.com
Sat Jan 17 20:47:05 PST 2009


== Quote from Walter Bright (newshound1 at digitalmars.com)'s article
> void A() nothrow {
>     try
>     {
>         B();
>     }
>     catch (Object o)
>     {
>         abort();
>     }
> }
> will do it.

The problem is that, at least according to my testing, this has significant
overhead, to the point where you may as well just not make A nothrow, from a
performance perspective.  Basically, what I'm asking is, if the compiler knew that
you weren't going to try to recover from a bException, could it do better than
catch { abort(); }?



More information about the Digitalmars-d mailing list