borrowed pointers vs ref

Walter Bright via Digitalmars-d digitalmars-d at puremagic.com
Tue May 13 10:44:02 PDT 2014


On 5/13/2014 6:50 AM, Dicebot wrote:
> Walter's initial post implies that he wanted to re-used `ref` for borrowed
> pointer (which would mean same semantics as `scope` parameter qualifier)

'ref' already is to much extent, for example:

   @safe int foo(ref int x) {
     auto a = &x;
     return 3;
   }

dmd foo -c
foo.d(4): Error: cannot take address of parameter x in @safe function foo


More information about the Digitalmars-d mailing list