示例位于:http ://www.d-programming-language.org/mixin.html ,如下所示:
template GenStruct(char[] Name, char[] M1) {
const char[] GenStruct = "struct " ~ Name ~ "{ int " ~ M1 ~ "; }";
} mixin(GenStruct!("Foo", "bar"));
“生成:”(根据网站):
struct Foo { int bar; }
给我一个错误:
Error: template instance GenStruct!("Foo","bar") GenStruct!("Foo","bar") does not match template declaration GenStruct(char[] Name,char[] M1)
是我的还是他们的虫子?