www.digitalmars.com         C & C++   DMDScript  

digitalmars.D.bugs - [Issue 17321] New: Example code for std.stdio.File fails to compile


          Issue ID: 17321
           Summary: Example code for std.stdio.File fails to compile
           Product: D
           Version: D2
          Hardware: All
                OS: All
            Status: NEW
          Severity: regression
          Priority: P1
         Component: phobos
          Assignee: nobody puremagic.com
          Reporter: bugzilla digitalmars.com


The example code is:

void main()
    import std.stdio;
    auto f = File("input");
    foreach (_; 0 .. 3)
        int a;
        f.readf!" %d"(a);

and does not compile:

test.d(8): Error: template instance std.stdio.File.readf!" %d" does not match
template declaration readf(Data...)(in char[] format, Data data) if
(allSatisfy!(isPointer, Data))

Apr 13 2017