On Wed, Jan 9, 2013 at 1:53 AM, Andrej Mitrovic <andrej.mitrov...@gmail.com> wrote: > On 1/9/13, bearophile <bearophileh...@lycos.com> wrote: >> If you define an inner static struct, its static methods can call >> each other freely. > > You can also use a mixin template: > > 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); > }
That's weird. Why does that work? Directly pasting the mixin content in main() does not compile, right?