rvalue references

Manu turkeyman at gmail.com
Tue Apr 23 08:33:20 PDT 2013


On 24 April 2013 01:01, deadalnix <deadalnix at gmail.com> wrote:

> On Tuesday, 23 April 2013 at 14:38:12 UTC, Dicebot wrote:
>
>> On Tuesday, 23 April 2013 at 14:28:54 UTC, Andrei Alexandrescu wrote:
>>
>>> If it were about scope it would be very careful with lifetime of
>>> temporaries.
>>>
>>> Andrei
>>>
>>
>> Please explain. In its current form DIP36 only cares that passed
>> temporary exists while called function is executed. I can't imagine any
>> sane lifetime rules that would result in violating this.
>>
>
> This isn't enough for a DIP. You have to explicitly define the lifetime,
> as it is required to know what is safe and what isn't, to get deterministic
> destruction, or whatever.
>

"The r-value being passed is assigned to a stack allocated temporary, which
has a lifetime that is identical to any other local variable, ie, the
lifetime of the function in which it appears."
There, I defined it.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d/attachments/20130424/ed9326de/attachment.html>


More information about the Digitalmars-d mailing list