Understanding DIP 1000 semantics -- Where's the bug?
Walter Bright
newshound2 at digitalmars.com
Thu Sep 26 05:27:28 UTC 2019
On 9/22/2019 10:01 AM, Mike Franklin wrote:
> I don't know. I think Walter is the only one that can clear this up.
int* foo(scope ref int* p, ref int* q)
{
return p; // error
return q; // ok
}
I.e. with `ref int*` there are two pointers here - the ref pointer and the *
pointer. The scope in `scope ref int*` refers to the * pointer, not the ref pointer.
More information about the Digitalmars-d
mailing list