streams.range

Defines some components that provide interoperability with Phobos ranges, including converting streams to and from ranges.

Members

Functions

asInputRange
auto asInputRange(S stream)

Wraps an existing input stream as a Phobos-style input range, to make any input stream compatible with functions that take input ranges.

asInputStream
auto asInputStream(R range)

Wraps a Phobos-style input range as an input stream.

asOutputRange
auto asOutputRange(S stream)

Wraps an existing output stream as a Phobos-style output range with a put method, to make any output stream compatible with functions that take output ranges.

asOutputStream
auto asOutputStream(R range)

Wraps a Phobos-style output range as an output stream.

asRange
auto asRange(S stream)

Converts the given stream to a range. Input streams are converted to input ranges, and output streams are converted to output ranges.

asStream
auto asStream(R range)

Converts the given range to a stream. Input ranges are converted to input streams, and output ranges are converted to output streams. Note that if the given range is both an input and an output range, an input stream is returned. Use asInputStream and asOutputStream to choose explicitly.

Structs

InputRangeStream
struct InputRangeStream(R, E = ElementType!R)

An input stream implementation that wraps around a Phobos-style input range.

InputStreamRange
struct InputStreamRange(S, E = StreamType!S)

A struct that, when initialized with an input stream, acts as a Phobos-style input range for elements of the same type.

OutputRangeStream
struct OutputRangeStream(R, E = ElementType!R)

An output stream implementation that wraps a Phobos-style output range.

OutputStreamRange
struct OutputStreamRange(S, E = StreamType!S)

A struct that, when initialized with an output stream, acts as a Phobos- style output range for elements of the same type.

Meta