Is @safe still a work-in-progress?

Atila Neves atila.neves at gmail.com
Fri Aug 17 12:30:26 UTC 2018


On Friday, 17 August 2018 at 11:37:54 UTC, rikki cattermole wrote:
> On 17/08/2018 11:33 PM, Atila Neves wrote:
>> . Good luck figuring out why your template functions aren't 
>> @safe and coaxing the compiler to tell you why it's inferring 
>> the attributes it is. Bonus points if it's a Phobos function 
>> so you can't slap `@safe` on its definition.
>
> Sure you can. It's a template so it'll be initialized as its 
> required.
>
> I've done that to fix a bug in druntime before and in my own 
> libraries.

It's not easy though. You have to either be building your own 
phobos or sudo editing files in /usr/include. You can, but it's a 
pain. Then there's finding out exactly where in a chain of 10 
template functions that it became @system...


More information about the Digitalmars-d mailing list