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

--- Comment #0 from Andrej Mitrovic <> 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:
------- You are receiving this mail because: -------

Reply via email to