D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 3303 - std.conv: range-to-integer conversion is broken.
Summary: std.conv: range-to-integer conversion is broken.
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: Other All
: P2 normal
Assignee: Andrei Alexandrescu
URL:
Keywords: patch
Depends on:
Blocks:
 
Reported: 2009-09-07 04:17 UTC by Kasumi Hanazuki
Modified: 2015-06-09 01:26 UTC (History)
2 users (show)

See Also:


Attachments
patch (944 bytes, patch)
2009-09-07 04:17 UTC, Kasumi Hanazuki
Details | Diff

Note You need to log in before you can comment on or make changes to this issue.
Description Kasumi Hanazuki 2009-09-07 04:17:56 UTC
Created attachment 446 [details]
patch

std.conv.parse!int only works with char ranges but not wchar nor dchar,
and should advance the given range.

----------

import std.conv, std.range;

void main() {
    auto r = take(6, "123 45"d);
    assert(parse!int(r) == 123);
    assert(r.front == ' ');
}
Comment 1 David Simcha 2010-08-15 08:34:25 UTC
This bug seems to have been fixed some time ago, as I can no longer reproduce it on 2.048.