<div dir="ltr">On 24 April 2013 04:44, Walter Bright <span dir="ltr"><<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote">
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div class="im">On 4/23/2013 8:33 AM, Manu wrote:<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, which has<br>
a lifetime that is identical to any other local variable, ie, the lifetime of<br>
the function in which it appears."<br>
There, I defined it.<br>
</blockquote>
<br></div>
Locals have a lifetime that is terminated by the closing } of the scope they appear in. There can be many such scopes in a function.<br>
<br>
There's also the issue of:<br>
<br>
a || b || c<br>
<br>
If b creates a temporary, it's life ends at the end of the expression or statement - it's complicated.<br>
</blockquote></div><br></div><div class="gmail_extra" style>Is it actually complicated?</div><div class="gmail_extra" style>Enclosing scope seems fine too. Can you suggest a case where it could escalate to an outer scope via a scope-ref argument?</div>
<div class="gmail_extra" style>So let's say then, that lifetime should be identical to a local declared in the same location. No change of any rules is required, it will work as expected.</div></div>