Thread overview
[Issue 1733] New: parse() function doesn't handle char, wchar, dchar
Dec 16, 2007
d-bugmail
[Issue 1733] parse() function does not handle all build-in types
Dec 26, 2007
d-bugmail
Dec 26, 2007
d-bugmail
December 16, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1733

           Summary: parse() function doesn't handle char, wchar, dchar
           Product: D
           Version: 2.008
          Platform: PC
        OS/Version: All
            Status: NEW
          Keywords: rejects-valid
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: bugzilla@digitalmars.com
        ReportedBy: aarti@interia.pl


string str = "aaaaa";
writefln(parse!(char)(str));

--
Result: conv.d(650): static assert  "Dunno how to parse a char"
---
Should work for generic code.


-- 

December 26, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1733


aarti@interia.pl changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
            Summary|parse() function doesn't    |parse() function does not
                   |handle char, wchar, dchar   |handle all build-in types




------- Comment #1 from aarti@interia.pl  2007-12-26 10:07 -------
Types which should at least be handled:
- char, wchar, dchar
- cfloat, cdouble, creal
- ifloat, idouble, ireal

Probably also (with default behaviour e.g. bool -> "true" -> true, "false" ->
false):
- bool
- string, wstring, dstring


-- 

December 26, 2007
http://d.puremagic.com/issues/show_bug.cgi?id=1733





------- Comment #2 from aarti@interia.pl  2007-12-26 10:13 -------
I initially thought that more types are covered by parse, but find out after looking at code that it works only for integral and real types.

So at least documentation should be improved.


-- 

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


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: -------
June 15, 2010
http://d.puremagic.com/issues/show_bug.cgi?id=1733


Lars T. Kyllingstad <bugzilla@kyllingen.net> changed:

           What    |Removed                     |Added
----------------------------------------------------------------------------
                 CC|                            |bugzilla@kyllingen.net


--- Comment #3 from Lars T. Kyllingstad <bugzilla@kyllingen.net> 2010-06-15 01:45:00 PDT ---
to() and parse() can now convert from string to bool:
http://www.dsource.org/projects/phobos/changeset/1646

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


Andrei Alexandrescu <andrei@metalanguage.com> changed:

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


--- Comment #4 from Andrei Alexandrescu <andrei@metalanguage.com> 2010-09-26 12:04:13 PDT ---
Fixed: http://www.dsource.org/projects/phobos/changeset/2054 http://www.dsource.org/projects/phobos/changeset/2055

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