[Issue 9654] New: Template function cannot take string by ref T[len]

d-bugmail at puremagic.com d-bugmail at puremagic.com
Tue Mar 5 20:46:52 PST 2013


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

           Summary: Template function cannot take string by ref T[len]
           Product: D
           Version: D2
          Platform: All
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: DMD
        AssignedTo: nobody at puremagic.com
        ReportedBy: k.hara.pg at gmail.com


--- Comment #0 from Kenji Hara <k.hara.pg at gmail.com> 2013-03-05 20:46:45 PST ---
This code should work.

void foo(ref const char[8] str) {}
void bar(T)(ref const T[8] str) {}

void main()
{
    foo("testinfo");  // OK
    bar("testinfo");  // should be OK, but fails
}

-- 
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