Debian Codegraph @

tests/dmd/runnable/imports/test49a.d

raw
1 module imports.test49a;
2
3 import core.stdc.stdio;
4
5 int x;
6
7 template Foo(T)
8 {
9 static this()
10 {
11 printf("static this()\n");
12 assert(x == 0);
13 x++;
14 }
15
16 static ~this()
17 {
18 printf("static ~this()\n");
19 assert(x == 1);
20 x--;
21 }
22 }
23
24 void baz()
25 {
26 alias Foo!(int) bar;
27 }