Issue 13590

Add stdio.byChunk example using algorithm.joiner
This commit is contained in:
rsw0x 2015-03-21 18:43:17 -04:00
parent 9469e04844
commit 2621b7fe7e

View file

@ -2196,6 +2196,20 @@ void main()
}
---
$(XREF algorithm, joiner) can be used to join chunks together into a single
range lazily.
Example:
---
import std.algorithm, std.stdio;
void main()
{
//Range of ranges
static assert(is(typeof(stdin.byChunk(4096).front) == ubyte[]));
//Range of elements
static assert(is(typeof(stdin.byChunk(4096).joiner.front) == ubyte));
}
---
Returns: A call to $(D byChunk) returns a range initialized with the $(D File)
object and the appropriate buffer.