RFC: scope and borrowing

bearophile via Digitalmars-d digitalmars-d at puremagic.com
Tue Sep 23 02:17:47 PDT 2014


Marc Schütz:

> http://wiki.dlang.org/User:Schuetzm/scope

If a mutable argument of a function is tagged as unique, the type 
system guarantees that there are no other references to it. So 
can a function 'foo' like this be "strongly pure"?


int[] foo(unique int[] a) pure {
     a[0]++;
     return a;
}

Bye,
bearophile


More information about the Digitalmars-d mailing list