While working on bitfields code I've found a unique scenario that poses some annoyances when generating the code.

template XYZ(alias x) {
    enum XYZ = x.stringof ~ "=100;";
}

struct I { int i;}

I i_num;
int n;

mixin(XYZ!(i_num.i)); //cannot find variable i
mixin(XYZ!(n));

the mixins become:
i=100;
n=100;


Now, how do I get the template's stringof to print out 'i_num.i' and not 'i'?

Reply via email to