Thread overview
[Issue 1487] New: toString(string) and toString(Object)
Sep 09, 2007
d-bugmail
September 09, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1487

           Summary: toString(string) and toString(Object)
           Product: D
           Version: unspecified
          Platform: All
        OS/Version: All
            Status: NEW
          Severity: enhancement
          Priority: P4
         Component: Phobos
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: dhasenan@gmail.com


For convenience, std.string should provide toString overloads that accept char[], const(char)[], and Object. Currently, for generic template code, you have to do the following:

---
import std.string;
alias std.string.toString toString;
string toString(Object o) { return (o ? o.toString : "null"); }
string toString(string s) { return s; }

template (T) {
   T t;
   // ...
   toString(t);
}
---


-- 

October 11, 2009
http://d.puremagic.com/issues/show_bug.cgi?id=1487


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|NEW                         |ASSIGNED
                 CC|                            |andrei@metalanguage.com
         AssignedTo|nobody@puremagic.com        |andrei@metalanguage.com


-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
September 25, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=1487


Andrei Alexandrescu <andrei@metalanguage.com> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
             Status|ASSIGNED                    |RESOLVED
         Resolution|                            |FIXED


--- Comment #1 from Andrei Alexandrescu <andrei@metalanguage.com> 2010-09-25 15:41:40 PDT ---
std.conv has settled this a while ago.

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