D not considered memory safe
Walter Bright
newshound2 at digitalmars.com
Thu Jul 25 02:12:19 UTC 2024
On 7/14/2024 6:34 AM, Dukc wrote:
> He has complained that lambdas like `(@trusted { list.list_delete(); })()` are a
> bad practice, since they hide the fact a `@safe` function is actually calling
> unsafe functions. But isn't this much worse? Not only are `@safe` functions
> calling unsafe functions, there isn't even a `@trusted` in the function body to
> warn about the fact!
>
> I'd have expected Walter to mark the calling functions `@trusted` instead, if he
> feels the lambda trick is too dangerous.
It wasn't just me. Quite a few people realized that the @trusted lambda approach
did not work.
More information about the Digitalmars-d
mailing list