On 06/21/14 05:32, Paul D Anderson via Digitalmars-d-learn wrote:
> I can't use a template mixin:
> 
> mixin template Function(string name)
> {
>   const char[] Function =
>     "public static int " ~ name ~ "() { return other.module." ~ name ~"; }";
> }
> 
> Error: mixin templates are not regular templates.

   mixin template Function(string name) {
      mixin("public static int " ~ name ~ "() { return other.module." ~ name 
~"; }");
   }

   struct S {
      mixin Function!"fctn1";
   }

artur

Reply via email to