This is probably a stupid question, but I cannot get a simple mixin to work: template Test(R, N=char[]) { mixin(R.stringof~" "~N~"() { return "~R.stringof~".init; }"); } class C { mixin Test!(bool, "T"); } gives: mixin Test!(bool, "T") does not match any template declaration So there's obviously some basic stuff I don't get here...