Regarding nothrow and @safe

bearophile bearophileHUGS at lycos.com
Sat Aug 20 11:16:03 PDT 2011


Sean Eskapp:

> Does nothrow mean the function itself does not through exceptions, or that the
> function body, as well as any called functions, do not throw? I wonder because
> allocating new memory inside a @safe nothrow function works, even though I'm
> used to "new" allocations throwing exceptions or Out-Of-Memory errors.

As far as I know they have decided to make memory overflow errors, so they are not exceptions, you can't catch them. Other people will confirm this or not.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list