String of templated struct at compile time

divi a at b5.re
Thu Sep 19 21:55:57 UTC 2019


You know what, just because I want to watch the world burn I did 
the horrible hacky way.

mixin template Magic()
{
   import std.array : split;
   static if (is(typeof(this) == T!(A), alias T, A...)) {
     mixin(`alias Other = ` ~ T.stringof.split('(')[0] ~ 
`!(K.B);`);
   }
   else
   {
     static assert (0);
   }
}


More information about the Digitalmars-d-learn mailing list