DIP1000: Scoped Pointers (Discussion)
Kagamin via Digitalmars-d
digitalmars-d at puremagic.com
Thu Aug 11 04:03:29 PDT 2016
On Thursday, 11 August 2016 at 08:29:37 UTC, John Colvin wrote:
> lifetime(a) = all of foo
> lifetime(c) = infinite (because null) //initially
> lifetime(b) = lifetime(&a) = lifetime(a) = all of foo // ????
> lifetime(c) = lifetime(&b) = lifetime(b) = all of foo //on
> assignment in bar
>
> That would suggest that dereferencing c was OK, because the
> lifetime is all of foo. What am I missing?
I believe the rule should be
lifetime(&e)=visibility(e)&lifetime(e).
More information about the Digitalmars-d
mailing list