why mixin template can not inclulde statement;

Kagamin spam at here.lot
Fri Aug 10 13:54:44 UTC 2018


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;
}


More information about the Digitalmars-d-learn mailing list