Page 1 of 1

[HD Pg 29, Sec. 2.1.3 - scope-and-lifespan]

Posted: Mon Dec 16, 2019 2:51 pm
by Username987654
t.data is accessible therefore, it will compile fine even though the object referred to by t has already ceased to exist
It cannot be guaranteed that "the object referred to by t has already ceased to exist". It can only be guaranteed that the object does not have a reference. Correct?

Re: [HD Pg 29, Sec. 2.1.3 - scope-and-lifespan]

Posted: Mon Dec 16, 2019 10:29 pm
by admin
Yes, the programmer can only ensure that there are no references to an object. But from the perspective of the topic of this discussion, i.e. from the perspective of the lifespan scope, the object practically does not exist.