Skip to content

Commit

Permalink
Issue 13590
Browse files Browse the repository at this point in the history
Add stdio.byChunk example using algorithm.joiner
  • Loading branch information
HK47196 committed Mar 21, 2015
1 parent 9469e04 commit 2621b7f
Showing 1 changed file with 14 additions and 0 deletions.
14 changes: 14 additions & 0 deletions std/stdio.d
Expand Up @@ -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.
Expand Down

0 comments on commit 2621b7f

Please sign in to comment.