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

           Summary: toUTFz sometimes does not work with const parameters
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nob...@puremagic.com
        ReportedBy: andrej.mitrov...@gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrov...@gmail.com> 2011-09-08 
17:47:46 PDT ---
import std.utf;

void main()
{
    const char[] c = "";
    auto res1 = toUTFz!(const(char)*)(c);  // doesn't work
    auto res2 = toUTFz!(const(wchar)*)(c);  // works ok
}

D:\DMD\dmd2\windows\bin\..\..\src\phobos\std\utf.d(1481): Error: variable
std.utf.toUTFz!(const(char)*,const(char[])).toUTFz.str cannot modify const

test.d(8): Error: template instance std.utf.toUTFz!(const(char)*,const(char[]))
error instantiating

Funny thing is it works fine with immutable:

immutable char[] c = "";
auto res1 = toUTFz!(const(char)*)(c);  // ok

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

Reply via email to