Bug 10061 – formattedRead should be more generic and accept output ranges

Status
NEW
Severity
enhancement
Priority
P4
Component
phobos
Product
D
Version
D2
Platform
All
OS
All
Creation time
2013-05-10T13:48:42Z
Last change time
2024-12-01T16:17:35Z
Assigned to
No Owner
Creator
Martin Nowak
Moved to GitHub: phobos#9974 →

Comments

Comment #0 by code — 2013-05-10T13:48:42Z
import std.format, std.range; void main() { string line = "12 13 14"; // arrays work int[] ary; formattedRead(line, "%(%d %)", &ary); assert(ary == [12, 13, 14]); // output ranges auto app = appender!(int[])(); formattedRead(line, "%(%d %)", &app); assert(app.data == [12, 13, 14]); // delegates int cnt = 12; auto dg = (int v) { assert(v == cnt++); }; formattedRead(line, "%(%d %)", dg); }
Comment #1 by robert.schadek — 2024-12-01T16:17:35Z
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9974 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB