strange file behaviour

maarten van damme maartenvd1994 at gmail.com
Sun Mar 4 11:43:52 PST 2012


hello,
I wrote this little test:
import std.stdio;

void main(){
auto testfile=new File("test.txt");
 foreach(string line;lines(testfile))
writeln(line);
}
and get as error
src\main.d(6): Error: constructor std.stdio.lines.this (File f, dchar
terminator = cast(dchar)'\x0a') is not callable using argument types (File*)
src\main.d(6): Error: cannot implicitly convert expression (testfile) of
type File* to File

Why?
I've also noticed the argument to lines in the example was a stream but now
it claims to be a File. when I feed it a File it complains it is given a
*File... what am I doing wrong?
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.puremagic.com/pipermail/digitalmars-d-learn/attachments/20120304/c6e17693/attachment.html>


More information about the Digitalmars-d-learn mailing list