On Sun, Sep 23, 2012 at 7:16 PM, Ben Davis <ent...@cantab.net> wrote: > Here's another one that might work, and be less error-prone: > > mixin template Self() { > auto self = __traits(identifier, __traits(parent, {})); > } > > void test() { > mixin Self; > writeln(self); > > }
Oh, you're using {} as a local block (or anonymous delegate), right? That's a nice trick. I even works at the module level, nice one!