On Thursday, 3 May 2012 at 18:28:19 UTC, Mehrdad wrote:
What's wrong with passing a struct as scope ref const?

I want to avoid copying the struct, and its information is only read inside the function...

ref scope? hm? What additional semantics do you desire from that construct, which 'const ref' doesn't provide?

A a;

void fun(const scope ref A x)
{
// x goes out of scope, destroy it... oops it's a global variable!?
}

fun(a);

Reply via email to