@trusted attribute should be replaced with @trusted blocks
Joseph Rushton Wakeling
joseph.wakeling at webdrake.net
Wed Jan 15 23:16:21 UTC 2020
On Wednesday, 15 January 2020 at 19:14:13 UTC, ag0aep6g wrote:
> You're saying that an @safe function `f` is somehow more
> guaranteed to be safe than an @trusted function `g`, even
> though `f` may be calling `g`. I don't see how that makes sense.
No, I'm saying that it is useful to have a clear distinction,
visible in the API declaration, between functions whose promise
of memory safety can be validated by the compiler, versus
functions whose promise of memory safety cannot be validated by
the compiler.
It's a practical distinction, because it gives the developer
clarity about which parts of a codebase need to be examined in
order to rule out the possibility of memory safety violations.
More information about the Digitalmars-d
mailing list