On 03/10/18 18:33, Shachar Shemesh wrote: > ~this() { > writefln("%s destructed", &this); > assert(counter is null || counter is &localCounter); > } You might also want to add @disable this(this); and remove the dead code (i.e. - the case where the pointer is global) to reduce noise. I verified that neither one changes anything in the outcome. Shachar