Issue with module destructor order

Martin Nowak dawg at dawgfoto.de
Wed May 23 11:21:04 PDT 2012


> mixin template logIt()
> {
>    static shared this()
>    {
>      log(typeof(this).stringof ~ " init");
>    }
>
>    static shared ~this()
>    {
>      log(typeof(this).stringof ~ " deinit");
>    }
> }
Try "shared static this()" and it won't run as a class constructor.
http://dlang.org/class.html#StaticConstructor


More information about the Digitalmars-d mailing list