deprecating std.stream, std.cstream, std.socketstream

Stewart Gordon smjg_1998 at yahoo.com
Wed May 16 16:16:09 PDT 2012


On 16/05/2012 17:48, H. S. Teoh wrote:
> On Wed, May 16, 2012 at 05:41:49PM +0100, Stewart Gordon wrote:
<snip>
>> Why would anybody want to read a large binary file _one byte at a
>> time_?
> [...]
>
> import std.range;
> byte[] readNBytes(R)(R range, size_t n)
> 	if (isInputRange!R&&  hasSlicing!R)
> {
> 	return R[0..n];
> }

What if I want it to work on ranges that don't have slicing?

Stewart.


More information about the Digitalmars-d mailing list