Why is there no std.stream anymore?
Seb
seb at wilzba.ch
Mon Dec 11 23:33:44 UTC 2017
On Monday, 11 December 2017 at 22:58:53 UTC, Jordi Gutiérrez
Hermoso wrote:
> On Monday, 11 December 2017 at 21:21:51 UTC, Steven
> Schveighoffer wrote:
>> Use the undead repository:
>
> Wow, really? Is the removal of stream from D some kind of error
> that hasn't been corrected yet?
Well of course you can use ranges for it, see e.g. this simple
example:
---
void main(string[] args)
{
import std.conv, std.range, std.stdio;
foreach (d;
File(__FILE_FULL_PATH__).byChunk(4096).join.take(5)) {
writefln("%s", d.to!char);
}
}
---
Run here: https://run.dlang.io/is/Ann9e9
Though if you need superb performance, iopipe or similar will be
faster.
More information about the Digitalmars-d-learn
mailing list