mirror of
https://github.com/dlang/phobos.git
synced 2025-05-13 15:52:41 +03:00
Issue 13590
Add stdio.byChunk example using algorithm.joiner
This commit is contained in:
parent
9469e04844
commit
2621b7fe7e
1 changed files with 14 additions and 0 deletions
14
std/stdio.d
14
std/stdio.d
|
@ -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.
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue