rvalue references
Walter Bright
newshound2 at digitalmars.com
Tue Apr 23 23:52:12 PDT 2013
On 4/23/2013 8:32 PM, Manu wrote:
> Is it actually complicated?
It's a lot more complicated than simply destructing them at the end of a
function. You have to define what happens for conditionally executed expressions
|| && ?:, what happens at the end of a statement, what happens at a }, what
happens to for statement initializers, etc., for each statement type.
> Enclosing scope seems fine too. Can you suggest a case where it could escalate
> to an outer scope via a scope-ref argument?
> 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.
You cannot declare locals in conditionally compiled expressions. So it isn't as
simple as that.
More information about the Digitalmars-d
mailing list