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



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




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 next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6157




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
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6157


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
           Severity|normal                      |major



14:45:55 PDT ---
Whoa, this has now turned from CT failure to outputting garbage. I'm raising
importance of this:

import std.stdio;
import std.conv;

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

    writeln( to!string(cstr) );  bla
    writeln( to!string(wstr) );  // 972F90
    writeln( to!string(dstr) );  // 972F80
}

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




14:46:50 PDT ---

 Whoa, this has now turned from CT failure to outputting garbage.
Technically not garbage but the pointed value is interpreted as an integer. -- Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email ------- You are receiving this mail because: -------
Oct 06 2012
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=6157


Andrej Mitrovic <andrej.mitrovich gmail.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |RESOLVED
         Resolution|                            |DUPLICATE



10:34:43 PST ---
*** This issue has been marked as a duplicate of issue 8384 ***

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