<div dir="ltr">scope ref a(scope ref int x) { return x; }<div style>void b(scope ref int x);</div></div><div class="gmail_extra"><br><br><div class="gmail_quote">On 24 April 2013 11:02, Diggory <span dir="ltr"><<a href="mailto:diggsey@googlemail.com" target="_blank">diggsey@googlemail.com</a>></span> wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">On Wednesday, 24 April 2013 at 00:54:12 UTC, kenji hara wrote:<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">
2013/4/24 Manu <<a href="mailto:turkeyman@gmail.com" target="_blank">turkeyman@gmail.com</a>><br>
<br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
"The r-value being passed is assigned to a stack allocated temporary,<br>
which has a lifetime that is identical to any other local variable, ie, the<br>
lifetime of the function in which it appears."<br>
There, I defined it.<br>
<br>
</blockquote>
<br></div><div class="im">
Good definition. If add more,<br>
"getting address of "scope" parameter would be disallowed, at least in<br>
@safe code, because it would be regarded as the escape of stack allocated<br>
temporary."<br>
<br>
Kenji Hara<br>
</div></blockquote>
<br>
Why does the temporary need to exist any longer than the current statement? (the current lifetime of temporaries are the statement or expression). Surely any longer is just wasting stack space.<br>
</blockquote></div><br></div>