phobos: What type to use instead of File when doing I/O on streams?

Adam D. Ruppe via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 9 12:15:08 PST 2015


On Monday, 9 November 2015 at 08:49:08 UTC, J.Frank wrote:
> Hm. "Maybe the stream is seekable, maybe it is not" is not 
> really an option for a language that is supposed to be type 
> safe.

It just isn't known at compile time. Files, especially on Unix, 
are interchangeable at compile time but offer different 
capabilities at run time.

> Thank you for your solution, but this sounds more lika a hack.

Wrapper structs with alias this are basically how D does 
inheritance on a struct.


More information about the Digitalmars-d-learn mailing list