Why does destructor of global var isn't called?

Dru Dru at notreal.com
Tue Dec 25 19:32:47 UTC 2018


example:
-----------

struct A{
	int* arr;
	
	~this() {
		writeln("A destruct");
	}
}

static ~this() {
	writeln("module destruct");
}

A a;

void main() {
}

-----------

only prints "module destruct"


More information about the Digitalmars-d mailing list