Template: get function name

novice3 sorryno at em.ail
Mon Aug 17 09:59:21 UTC 2020


On Monday, 17 August 2020 at 09:45:55 UTC, novice3 wrote:
> access violation occur.

reduced code https://run.dlang.io/is/U58t9R

void test(out int x) { x = 42; }

void call (alias fn, Args ...)(Args args) { fn(args); }

void main(){
     int a;

     a = 111;
     test(a);
     assert(a == 42);  // OK

     a = 222;
     call!test(a);
     assert(a == 42);  // FAIL
}



More information about the Digitalmars-d-learn mailing list