Static constructors guaranteed to run?
ketmar via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Sun Jun 28 19:35:16 PDT 2015
p.s. also note that module can has several static ctors, i.e. this works
fine:
=== z00.d ===
module z00;
import std.stdio;
static this () { writeln("ctor0"); }
static this () { writeln("ctor1"); }
=== z01.d ===
module z01;
import z00;
void main () {}
this prints:
ctor0
ctor1
so you can several initialization functions to module with, for example,
mixins.
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 181 bytes
Desc: not available
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20150629/50794072/attachment-0001.sig>
More information about the Digitalmars-d-learn
mailing list