D issues are now tracked on GitHub. This Bugzilla instance remains as a read-only archive.
Issue 21233 - std.conv.parse doesn't report the number of characters consumed
Summary: std.conv.parse doesn't report the number of characters consumed
Status: RESOLVED FIXED
Alias: None
Product: D
Classification: Unclassified
Component: phobos (show other issues)
Version: D2
Hardware: x86 All
: P1 enhancement
Assignee: No Owner
URL:
Keywords: pull
Depends on:
Blocks:
 
Reported: 2020-09-09 12:31 UTC by adela.vais99
Modified: 2020-11-16 08:14 UTC (History)
0 users

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this issue.
Description adela.vais99 2020-09-09 12:31:35 UTC
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 adela.vais99 2020-09-21 20:53:24 UTC
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 Dlang Bot 2020-09-21 23:07:47 UTC
@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 Dlang Bot 2020-11-16 08:14:49 UTC
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