www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 10019] New: std.conv numeric parse functions do not work with std.container Array ranges

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

           Summary: std.conv numeric parse functions do not work with
                    std.container Array ranges
           Product: D
           Version: D2
          Platform: x86_64
        OS/Version: Windows
            Status: NEW
          Severity: normal
          Priority: P2
         Component: Phobos
        AssignedTo: nobody puremagic.com
        ReportedBy: moebiuspersona gmail.com



I believe the following ought to work.

auto arr = Array!dchar();

arr ~= "123";

assert(parse!int(arr[]) == 123)

The problem I believe is caused by the range there being an r-value, which
parse does not accept. I have a pull request incoming...

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 02 2013
next sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10019




https://github.com/D-Programming-Language/phobos/pull/1282 The pull request is
here.

-- 
Configure issuemail: http://d.puremagic.com/issues/userprefs.cgi?tab=email
------- You are receiving this mail because: -------
May 02 2013
prev sibling parent d-bugmail puremagic.com writes:
http://d.puremagic.com/issues/show_bug.cgi?id=10019


w0rp <devw0rp gmail.com> changed:

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



I was wrong, the parse functions really shouldn't take rvalues. Maybe some time
later they can be more accepting of lvalue ranges, however.

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