Am 23.05.2013 18:27, schrieb Gary Willoughby: > Why won't the following code compile? Here's the error: > > filewatcher.d(21): Error: cannot implicitly convert expression (new > File(file, "r")) of type File* to shared(_iobuf)* > > /** > * Imports. > */ > import std.stdio; > > /** > * A class to watch for changes in a file. > */ > class Example > { > /** > * Member variables. > */ > private FILE* _file; > > /** > * Constructor. > */ > public this(string file) > { > this._file = new File(file, "r"); > } > }
Because that's not the same: File != FILE you probably want the .handle