I have this little program:<div><br></div><div><div>import std.stdio;</div><div>import std.stream;</div><div><br></div><div><br></div><div>void main () </div><div>{</div><div><span style="white-space:pre-wrap"> </span>Stream file = new BufferedFile("spec.txt");</div>
<div><span style="white-space:pre-wrap"> </span>foreach(ulong n, string line; file) {</div><div><span style="white-space:pre-wrap"> </span>stdout.writefln("line %d: %s",n,line);</div>
<div><span style="white-space:pre-wrap"> </span>}</div><div><span style="white-space:pre-wrap"> </span>file.close();</div><div>}</div><div><br></div></div><div>which is basicall a cut-n-paste from <a href="http://digitalmars.com/d/2.0/phobos/std_stream.html" target="_blank">http://digitalmars.com/d/2.0/phobos/std_stream.html</a></div>
<div>which fails with:</div><div><div>solvejk.d(8): Error: function std.stream.Stream.opApply (scope int delegate(ref char[]) dg) is not callable using argument types (int delegate(ref ulong __apply</div><div>Arg0, ref string __applyArg1))</div>
<div>solvejk.d(8): Error: cannot implicitly convert expression (__foreachbody765) of type int delegate(ref ulong __applyArg0, ref string __applyArg1) to int delegate</div><div>(ref ulong n, ref wchar[] line)</div></div><div>
<br></div><div><br></div><div>This is on windows and dmd is Digital Mars D Compiler v2.050</div><div>downloded from <span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 12.5px; border-collapse: collapse; "><a href="http://ftp.digitalmars.com/dmd.2.050.zip" target="_blank" style="color: rgb(0, 0, 204); ">http://ftp.digitalmars.com/dmd.2.050.zip</a> (link from dmd annonce list)</span></div>
<div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 12.5px; border-collapse: collapse; "><br></span></div><div><span class="Apple-style-span" style="font-family: arial, sans-serif; font-size: 12.5px; border-collapse: collapse; ">where to go?</span></div>
<div><br></div><div><br></div>