On Tuesday, 5 May 2015 at 00:50:44 UTC, Freddy wrote:
----
void func(R)(R range){//expects range of strings
    string[] elms=range.read(5);
    string[] elms2=range.read(9);
    /++..++/
}


void caller(){
    auto file=...;//unbuffered file
    file.map!(a=>a.to!string).func();
}
----
Wait, Bad example,
----
void func(R)(R range){//expects range of ubyte
    ubyte[] data=range.read(VERY_BIG_NUMBER);
    ubyte[] other_data=range.read(OTHER_VERY_BIG_NUMBER);
}
----
which would be more optimal for a file but still works for other ranges, compared to looping though the ranges read appending to data.

Reply via email to