<div dir="ltr">On 24 April 2013 14:07, deadalnix <span dir="ltr"><<a href="mailto:deadalnix@gmail.com" target="_blank">deadalnix@gmail.com</a>></span> wrote:<br><div class="gmail_extra"><div class="gmail_quote"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
<div class="im">On Wednesday, 24 April 2013 at 03:33:07 UTC, Manu wrote:<br>
</div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex"><div class="im">
On 24 April 2013 04:44, Walter Bright <<a href="mailto:newshound2@digitalmars.com" target="_blank">newshound2@digitalmars.com</a>> wrote:<br>
<br>
</div><div><div class="h5"><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
On 4/23/2013 8:33 AM, Manu wrote:<br>
<br>
<blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">
"The r-value being passed is assigned to a stack allocated temporary,<br>
which has<br>
a lifetime that is identical to any other local variable, ie, the<br>
lifetime of<br>
the function in which it appears."<br>
There, I defined it.<br>
<br>
</blockquote>
<br>
Locals have a lifetime that is terminated by the closing } of the scope<br>
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<br>
statement - it's complicated.<br>
<br>
</blockquote>
<br></div></div><div class="im">
Is it actually complicated?<br>
Enclosing scope seems fine too. Can you suggest a case where it could<br>
escalate to an outer scope via a scope-ref argument?<br>
So let's say then, that lifetime should be identical to a local declared in<br>
the same location. No change of any rules is required, it will work as<br>
expected.<br>
</div></blockquote>
<br>
The issue is that in this case for instance, the temporary is conditionally created. Then cannot bind to the enclosing scope.<br></blockquote><div><br></div><div style>Conditionally created, in the event you pass an rvalue or not? What about binding?<br>
</div><div style>I don't know what you're saying.</div><div style><br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left-width:1px;border-left-color:rgb(204,204,204);border-left-style:solid;padding-left:1ex">

As temporaries can now be created all over the place, it is mandatory to define them in a much more specific way than it is done right now.</blockquote><div><br></div><div style>...I don't follow. There's absolutely nothing special about an implicitly created temp vs an explicit one.</div>
</div></div></div>