What's the current phobos way to define generic data sources and sinks?

John Colvin john.loughran.colvin at gmail.com
Thu Apr 17 02:21:13 PDT 2014


On Thursday, 17 April 2014 at 08:45:29 UTC, Hannes Steffenhagen 
wrote:
> I wanna write a parser that can read the input text from an 
> arbitrary source. That's going to be files for most of the 
> time, but I don't want to unnecessarily limit it. It's a line 
> based format, so I supposed InputRange!string would do in this 
> case?

I would recommend writing a range using a struct instead of 
inheriting from InputRange. See here for an introduction to 
ranges: http://ddili.org/ders/d.en/ranges.html


More information about the Digitalmars-d-learn mailing list