On 1/28/12, Trass3r <[email protected]> wrote: > The extra template is senseless.
No it's not. Your sample won't compile with -property. That's why I've wrapped it into a template, to avoid having to use parens. > And no imports are needed. Fair enough. But if we're going to be anal about it you should add a constraint `if (is(EnumType == enum))`. Otherwise your sample will compile for non-enum types, which may or may not be what you want. You probably don't want to end up with static method imported into the local scope by accident. For classes it will generate: alias MyClass.toString toString; alias MyClass.toHash toHash; alias MyClass.opCmp opCmp; alias MyClass.opEquals opEquals; alias MyClass.Monitor Monitor; alias MyClass.factory factory; Fun! :)
