There is an example in http://www.digitalmars.com/d/2.0/mixin.html, like belown:
template GenStruct(char[] Name, char[] M1)
{
const char[] GenStruct = "struct " ~ Name ~ "{ int " ~ M1 ~ "; }";
}
mixin(GenStruct!("Foo", "bar"));
It can be compiled when using in a demo. The char[] should be changed to string.
By the way, it seems that the mixin can only accept the type of const char[]. Should it take string type?
Comment #1 by k.hanazuki — 2011-10-25T08:21:35Z
*** This issue has been marked as a duplicate of issue 1986 ***