Another bug?

Jack Applegame via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Jan 30 04:15:59 PST 2017


WORKAROUND:

import std.stdio;

struct Foo {
     int val = 0;
     ~this() {
         writefln("destruct %s", val);
     }
}

void bar(ARGS...)() {
     struct Tuple {
         ARGS args;
         alias args this;
     }
     Tuple args;
     args[0].val = 1;
     writefln("val = %s", args[0].val);
}


void main() {
     bar!Foo();
}



More information about the Digitalmars-d-learn mailing list