On Friday, 1 March 2013 at 03:44:30 UTC, H. S. Teoh wrote:

You can make a buffered range that reads in a large chunk of data at a time, and .front and .popFront merely move an internal pointer until it reaches the end of the buffer, then the next buffer page is loaded in. In this case, .front is very simple (just a pointer lookup) and will
probably be inlined by an optimizing compiler.

Just because the abstraction is reading per-element, doesn't mean the
implementation has to literally do that!


T

Isn't this essentially what is going on in stdio when a range uses fread?

Reply via email to