www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 6157] New: to!string should work for various pointer types

reply d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6157

           Summary: to!string should work for various pointer types
           Product: D
           Version: D2
          Platform: Other
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: andrej.mitrovich gmail.com


--- Comment #0 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2011-06-14
15:34:46 PDT ---
import std.conv;

void main()
{
    char*  cstr = "bla".dup.ptr;
    wchar* wstr = "bla"w.dup.ptr;
    dchar* dstr = "bla"d.dup.ptr;

    to!string(cstr);    // ok
    to!string(wstr);    // fail
    to!string(dstr);    // fail
}

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jun 14 2011
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6157



--- Comment #1 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-01-04
16:59:06 PST ---
Created an attachment (id=1067)
utf

Added implementation to be added to std.conv. These have to be further
verified.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
Jan 04 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6157



--- Comment #2 from Andrej Mitrovic <andrej.mitrovich gmail.com> 2012-01-04
17:00:31 PST ---
Btw, several people have asked for to!(char*)/to!(wchar*)/to!(dchar*) to work,
so I've added a simple template overload that forwards to toUTFz. Personally I
think this is a good convenience.

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