Time to start compiling with -dip25

Tony tonytdominguez at aol.com
Sat Dec 29 07:19:41 UTC 2018


https://github.com/dlang/DIPs/blob/master/DIPs/archive/DIP25.md

>Sealed references

>In a nutshell
>This DIP proposes that any ref parameter that a function 
>received and also wants to
>return must be also annotated with return. Annotation are 
>deduced for templates and
>lambdas, but must be explicit for all other declarations.

>Example:

>@safe:
>ref int fun(ref int a) { return a; } // ERROR
>ref int gun(return ref int a) { return a; } // FINE
>ref T hun(T)(ref T a) { return a; } // FINE, templates use 
>deduction


More information about the Digitalmars-d mailing list