[Issue 6388] New: Bad example about Mixin

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Jul 26 19:52:32 PDT 2011


http://d.puremagic.com/issues/show_bug.cgi?id=6388

           Summary: Bad example about Mixin
           Product: D
           Version: D2
          Platform: Other
        OS/Version: All
            Status: NEW
          Severity: normal
          Priority: P2
         Component: websites
        AssignedTo: nobody at puremagic.com
        ReportedBy: bitworld at qq.com


--- Comment #0 from Heromyth <bitworld at qq.com> 2011-07-26 19:52:29 PDT ---
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?

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------


More information about the Digitalmars-d-bugs mailing list