Bug 10019 – std.conv numeric parse functions do not work with std.container Array ranges

Status
RESOLVED
Resolution
INVALID
Severity
normal
Priority
P2
Component
phobos
Product
D
Version
D2
Platform
x86_64
OS
Windows
Creation time
2013-05-02T12:58:00Z
Last change time
2013-06-13T11:03:47Z
Assigned to
nobody
Creator
devw0rp

Comments

Comment #0 by devw0rp — 2013-05-02T12:58:04Z
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...
Comment #1 by devw0rp — 2013-05-02T13:18:24Z
Comment #2 by devw0rp — 2013-06-13T11:03:47Z
I was wrong, the parse functions really shouldn't take rvalues. Maybe some time later they can be more accepting of lvalue ranges, however.