A partial solution would be something like this:

    mixin template makeProperty(T, string name, alias func) {
        enum p = makeUnnamedProperty!(T, func);
        mixin("enum %s = p;".format(name)); // or alias
    }

however now the parent namespace is polluted with "p", is there any way to hide it away and/or avoid it?

I may be wrong, but I guess the whole thing boils down to a question whether it's possible to have a mixin template with signature 'bind(string name, alias symbol)' which generates 'enum foo = bar;' when called as 'mixin bind!("foo", bar)'?

Reply via email to