try this: mixin template test(A...){ __gshared int a = A[0]; int dummy = (){ a++; return 0; }(); }
import core.stdc.stdio; int main(){ mixin test!1; printf("a=%d\n", a); return 0; }
Kagamin via Digitalmars-d-learn Fri, 10 Aug 2018 06:56:11 -0700
try this: mixin template test(A...){ __gshared int a = A[0]; int dummy = (){ a++; return 0; }(); }
import core.stdc.stdio; int main(){ mixin test!1; printf("a=%d\n", a); return 0; }