On Wednesday, 9 January 2013 at 00:53:16 UTC, Andrej Mitrovic
wrote:
mixin template S()
{
void test(ref int x) { x = test(); }
int test() { return 1; }
}
void main()
{
mixin S;
int x;
test(x);
assert(x == 1);
}
An interesting idea, but the more obvious uses it would be for
is bitfields or something similar, which is generated text and
mixed in. Would you do a mixin within a mixin template to get
that to work? I'd rather just mixin directly to the function.
//works with above main?
mixin template S()
{
mixin(bitfields!(
int, "test", 8,
));
}