On 08/15/2016 12:32 PM, Kagamin wrote:
> On Sunday, 14 August 2016 at 20:02:35 UTC, Walter Bright wrote:
>> auto r = range;
> 
> You said that if a value (range in this case) is returned by scope, its
> lifetime is restricted to its expression, hence it can't be assigned to
> a variable, because the variable outlives the expression.

As far as I understood Walter, his explained behaviour should happen if
function is NOT annottated with scope and will be a default out-of-box
one when trying to "borrow" stack-allocated data. Not sure yet how it
should work with more complex cases (i.e. container stores a slice /
pointer internally and not just int).

Attachment: signature.asc
Description: OpenPGP digital signature

Reply via email to