Bug 6388 – Bad example about Mixin

Status
RESOLVED
Resolution
DUPLICATE
Severity
normal
Priority
P2
Component
dlang.org
Product
D
Version
D2
Platform
Other
OS
All
Creation time
2011-07-26T19:52:00Z
Last change time
2011-10-25T08:21:35Z
Assigned to
nobody
Creator
bitworld

Comments

Comment #0 by bitworld — 2011-07-26T19:52:29Z
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 ***