DIP 1021--Argument Ownership and Function Calls--Final Review

Walter Bright newshound2 at digitalmars.com
Wed Sep 18 09:50:47 UTC 2019


On 9/17/2019 8:54 AM, Exil wrote:
>      @safe:
> 
>      void foo(ref int, ref int) {
>      }
> 
>      void test() {
>          int[5] arr;
> 
>          // foo(arr[0], arr[0]); // error here
> 
>          foreach(size_t i, ref int a; arr) {
>              foo(a, arr[i]); // but ok here
>          }
>      }

That's a problem with the implementation, not the DIP.



More information about the Digitalmars-d mailing list