www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 1733] New: parse() function doesn't handle char, wchar, dchar

reply d-bugmail puremagic.com writes:
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.


-- 
Dec 16 2007
next sibling parent d-bugmail puremagic.com writes:
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





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


-- 
Dec 26 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1733






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.


-- 
Dec 26 2007
prev sibling next sibling parent d-bugmail puremagic.com writes:
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: -------
Oct 11 2009
prev sibling next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=1733


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

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



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


Andrei Alexandrescu <andrei metalanguage.com> changed:

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



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: -------
Sep 26 2010