DIP69 - Implement scope for escape proof references
deadalnix via Digitalmars-d
digitalmars-d at puremagic.com
Wed Dec 10 16:35:44 PST 2014
On Wednesday, 10 December 2014 at 22:20:37 UTC, Ola Fosheim
Grøstad wrote:
> On Wednesday, 10 December 2014 at 22:05:10 UTC, deadalnix wrote:
>> That is completely off topic. this is a function parameter, you
>> can return scope, and you don't need to know who own the
>> container for that to work.
>
> You have many scopes, if two different scopes pass in "horses"
> to a function in a recursive chain then you need to know which
> horse the returned "leg" belongs to…
>
> But by all means… go ahead if you think it is off topic. (it
> isn't)
It is always safe to consider scopeness of the retrun value (if
marked scope) as being the intersection of the lifetime of
parameters.
That should cover most bases, and we can still extends later if
this is too limited (I suspect it is ok for most cases).
More information about the Digitalmars-d
mailing list