@trusted attribute should be replaced with @trusted blocks

IGotD- nise at nise.com
Wed Jan 15 21:17:38 UTC 2020


On Wednesday, 15 January 2020 at 19:49:53 UTC, Joseph Rushton 
Wakeling wrote:
> No.  @trusted is about saying "This function should be safe to 
> use, but that safety has been designed by the developer rather 
> than being automatically verifiable by the compiler."
>
> Contrast with @system which can be applied to functions that 
> are inherently not guaranteed to be safe -- e.g. where the 
> safety (or not) depends on what input the user provides.

This is why I think it should be removed. In my world there is no 
"trust the human". Also @trusted in kind of backwards. It should 
be the caller that designate a call or operation trusted, not the 
the function that you call. Otherwise it is like asking car sales 
man if I can trust him.


More information about the Digitalmars-d mailing list