Referring to alias parameters in a mixin template

aldanor via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Tue Dec 16 18:34:15 PST 2014


On Wednesday, 17 December 2014 at 02:12:52 UTC, anonymous wrote:
> Sure, straight forward:
>
>       mixin template makeProperty(T, string name, alias func) {
>           mixin("T %s() @property { return func();
> }".format(name));
>       }

Indeed... thanks! Just one thing that I find confusing here -- how
exactly do T and func resolve when this template is mixed in?
What if there was another local symbol named "func" in the target
scope?


More information about the Digitalmars-d-learn mailing list