streams to ranges adapters

Jonathan M Davis jmdavisprog at gmail.com
Wed Sep 1 03:45:18 PDT 2010


On Wednesday 01 September 2010 03:19:41 Diego Martinelli wrote:
> Hi all!
> I'm digging the documentation of phobos but I am still learning D and I
> can't help myself.
> I feel like there's a lack of adapters between streams and ranges
> (something like istream_iterator/ostream_iterator in STL).

A properly written stream type _is_ a range with no adaptors necessary. However, 
std.stream predates much of the range stuff in Phobos, so its implementation does 
not support ranges. The intention is to replace it with a streaming module that 
_does_ properly support ranges. However, it's on the TODO list and hasn't been 
done yet. IIRC, there's at least one implementation which has been discussed on 
the Phobos list which may end up as the replacement for std.stream, but it 
hasn't happened yet, so Phobos does not yet support using ranges with streams.

- Jonathan M Davis


More information about the Digitalmars-d-learn mailing list