Preventing nested struct destructor accessing stack frame
Nick Treleaven
nick at geany.org
Fri Dec 16 13:07:31 UTC 2022
On Friday, 16 December 2022 at 12:17:40 UTC, Nick Treleaven wrote:
> It seems destroy clears the context pointer. Is there a way to
> test if the context pointer is null in the dtor, to prevent the
> increment?
This seems to work:
~this() @trusted { if (&i > cast(void*)1024) i++; }
It would be better if there was a struct property to get the
context pointer though.
More information about the Digitalmars-d-learn
mailing list