Temporary @trusted scope

Per Nordlöw per.nordlow at gmail.com
Tue Dec 18 12:34:23 UTC 2018


On Tuesday, 18 December 2018 at 10:42:51 UTC, Jonathan M Davis 
wrote:
> Unfortunately, D does not currently have a way to do that. Only 
> functions can be marked with @trusted. However, the typical 
> approach to this problem is to use a lambda, which is more or 
> less syntactically the same except that it has some extra 
> parens. e.g.
>
> () @trusted { doUnsafe(); }();

Is there a performance hit when using this?


More information about the Digitalmars-d-learn mailing list