On Tuesday, 7 June 2016 at 18:24:33 UTC, Walter Bright wrote:
Add:

   @safe:

at the top of your D module and you'll find the @system code.

Sure, that's easy to do in my code, but we were talking about 3rd party code. Plus the template problem comes up again: no one should be annotating their templates anything but maybe @property. So in practice, because you recommend (correctly) that everything should be a template, there's nothing to grep.

You can also add:

   @nogc:

at the top, too. It isn't necessary to tediously annotate every function.

Are you sure? @nogc is not like @safe in that it has a corresponding negating version to cancel the top level out. If I have @nogc at the top, there's no way to declare an allocating function in that file, therefore you have to use @nogc {}. This is why some have proposed hacks like !@nogc.


Reply via email to