Wraps an existing input stream as a Phobos-style input range, to make any
input stream compatible with functions that take input ranges. The given
stream is stored as a pointer in the underlying range implementation, so you
should still manage ownership of the original stream.
import std.range.primitives : isInputRange;
import streams;
auto stream = inputStreamFor!int([1, 2, 3]);
auto range = asInputRange!int(stream);
assert(isInputRange!(typeof(range)));
Wraps an existing input stream as a Phobos-style input range, to make any input stream compatible with functions that take input ranges. The given stream is stored as a pointer in the underlying range implementation, so you should still manage ownership of the original stream.