Time to start compiling with -dip25

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


>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.


>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 

More information about the Digitalmars-d mailing list