On 09/12/2014 16:25, Steven Schveighoffer wrote:
But I thought if you take a reference from the stack, it's inferred as
scope? I feel like there's a missing link somewhere if the scope is
missing from the parameter.

I think (with this DIP) values on the stack can safely be passed as a ref parameter, which is a bit more flexible than a scope parameter.

Will ref just automatically bind to any scoped reference?

What about this:

(for reference:)
int x;
scope ref int foo(ref int x);

auto y = &x;

foo(*y) += 1;

y gets inferred as scope, but *y is not scope, so it should work.

Reply via email to