Bug 21233 – std.conv.parse doesn't report the number of characters consumed
Status
RESOLVED
Resolution
FIXED
Severity
enhancement
Priority
P1
Component
phobos
Product
D
Version
D2
Platform
x86
OS
All
Creation time
2020-09-09T12:31:35Z
Last change time
2020-11-16T08:14:49Z
Keywords
pull
Assigned to
No Owner
Creator
adela.vais99
Comments
Comment #0 by adela.vais99 — 2020-09-09T12:31:35Z
I was working with an input range and I would find it useful to be able to do something like:
int ctr = 0;
val = input.parse!int(ctr);
and then use ctr for location tracking purposes.
Comment #1 by adela.vais99 — 2020-09-21T20:53:24Z
After analysing the source code, I see that there is already an overload that receives as a second parameter an integer, so my example above is impossible.
It was only an example, the problem is that parse doesn't report the number of characters consumed, and it doesn't really matter the way I receive this information.
Comment #2 by dlang-bot — 2020-09-21T23:07:47Z
@adelavais created dlang/phobos pull request #7642 "Fix Issue 21233 - std.conv.parse doesn't report the number of charact…" fixing this issue:
- Fix Issue 21233 - std.conv.parse doesn't report the number of characters consumed
https://github.com/dlang/phobos/pull/7642
Comment #3 by dlang-bot — 2020-11-16T08:14:49Z
dlang/phobos pull request #7642 "Fix Issue 21233 - std.conv.parse doesn't report the number of charact…" was merged into master:
- 77514ac15f30585366f9ff53c74126ef04571c08 by Adela Vais:
Fix Issue 21233 - std.conv.parse doesn't report the number of characters consumed
https://github.com/dlang/phobos/pull/7642