Program crash: GC destroys an object unexpectedly
eugene
dee0xeed at gmail.com
Tue Sep 21 21:02:56 UTC 2021
On Tuesday, 21 September 2021 at 20:47:41 UTC, H. S. Teoh wrote:
> And since stopper isn't used anymore after declaration, an
> optimizing compiler is free to assume that it's not needed
> afterwards, so it's not obligated to keep the reference alive
> until the end of the function.
It was not obvious for me,
I thought lifetimes always
lasts until the end of a scope
(main in this case).
More information about the Digitalmars-d-learn
mailing list