[phobos] std.stdio : ByChunk for File

Shin Fujishiro rsinfu at gmail.com
Fri Aug 27 21:02:43 PDT 2010


Andrei Alexandrescu <andrei at erdani.com> wrote:
> On 5/31/10 10:00 PDT, Shin Fujishiro wrote:
> >> I want chunks of Range version like ByLine(and I hope byChunk returns
> >> ByChunk).
> >
> > I want it too.
> >
> > But ByChunk should be more generic IMO.  It should be an adaptor which
> > converts some "bulk input" to range.
> >
> > This is a bulk input model (similar to the Source concept*1):
> > ----------
> > struct BulkInput
> > {
> >      // Returns true if there is no more data
> >      bool eof();
> >
> >      // Reads data in buf and returns the number of elements read
> >      size_t read(T[] buf);
> >      size_t read(U[] buf);
> >      ...
> > }
> > ----------
> 
> What types are T and U?

They were meant as placeholders.  Although I can't recall why I wrote
the multiple reads.  That didn't make much sense.


Shin


More information about the phobos mailing list