Imagine a resource wrapper like so: class Foo { int *mem; this() { mem = cast(int *)malloc(int.sizeof); } ~this() { .free(mem); } }Now, you have a problem if you do something like this: class Bar { Foo foo; ~this() { delete foo; } }
Is there a valid use case for something like this? Why would you want to do anything inside ~this with GC memory?