Dear, When you need to manage various file format and trying to fit as a phobos File it appear below feature could be really interesting. by example you have a parser you want to construct is from various file type you can grant some methods. ----------------------------------------------------------- template isFileType(F) { enum bool isFileType = is(typeof( { ubyte[] buf; F f = void; // can define a FileType object if (f.eof) {} // can test for end of file if (f.isOpen) {} // can test for opened file f.name; // can invoke name f.close(); // can invoke close r.write(); // can invoke write() r.rawWrite( "" ); // can invoke rawWrite() r.rawRead( buf ); // can invoke rawRead() })); } struct FileType( F ) if( isFileType( F ) ) { F _f; this( F file ){ _f = file; } alias _f this; }
By example we can do with it a range to manage both stream and file http://dpaste.dzfl.pl/1f2bcf39
I suggest you to give a more precise title to this issue.
English is not my first language so if you have a good one. You are welcome :-)
THIS ISSUE HAS BEEN MOVED TO GITHUB https://github.com/dlang/phobos/issues/9961 DO NOT COMMENT HERE ANYMORE, NOBODY WILL SEE IT, THIS ISSUE HAS BEEN MOVED TO GITHUB