https://issues.dlang.org/show_bug.cgi?id=20392
Issue ID: 20392
Summary: formattedRead: %*d and %d should read the same
Product: D
Version: D2
Hardware: All
OS: All
Status: NEW
Severity: normal
Priority: P1
Component: phobos
Assignee: [email protected]
Reporter: [email protected]
This throws an exception:
---
import std.format;
void main()
{
string str = "foo bar buzz";
string a, c;
int b;
formattedRead(str, "%s %d %s", &a, &b, &c);
}
---
This not:
---
import std.format;
void main()
{
string str = "foo bar buzz";
string a, c;
formattedRead(str, "%s %*d %s", &a, &c);
}
---
The reason is, that %*d accepts an empty string as a number while %d doesn't.
--