DIP 1028---Make @safe the Default---Community Review Round 1

Walter Bright newshound2 at digitalmars.com
Thu Jan 9 05:29:49 UTC 2020


On 1/8/2020 4:12 PM, Manu wrote:
> unsafe blocks is distinctly preferable to me. Functions are usually >1
> line, and I hate that we can only mark this at the function level.
> Unsafely statements are never at the function level, it's usually just
> one line among a larger function. An unsafe scope would be immensely
> preferable to me, because I can make it as narrow as the code i'm
> suspicious of, and the surrounding code doesn't lose its safe checking
> just by being a bystander.

This is routinely done in Phobos by making a tiny one line anonymous @trusted 
lambda and immediately calling it. The compiler will inline it.



More information about the Digitalmars-d mailing list