exceptions vs error codes

Chris Wright via Digitalmars-d digitalmars-d at puremagic.com
Sun Jul 10 09:47:31 PDT 2016


On Sun, 10 Jul 2016 07:06:28 +0000, ketmar wrote:

> it seems that OP wants a kind of compiler switch (or pragma, or
> attribute) to magically turn `throw` into returning some kind of "error
> value". and we already has too much dangerous compiler switches like
> that (even one is too much, and we have two).

But as an annotation like @nogc it would work.

You do need a try/catch in every annotated function to catch runtime 
exceptions like OutOfMemoryError.


More information about the Digitalmars-d mailing list