On 16.12.22 14:07, Nick Treleaven wrote:
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.

A quick test suggests that the context pointer is the last item in `tupleof`. So this might do the trick:

    ~this() { if (this.tupleof[$ - 1] !is null) i++; }

I don't know if it's guaranteed to work though. Might be an implementation detail.

Reply via email to