projections in D

bearophile via Digitalmars-d-learn digitalmars-d-learn at puremagic.com
Mon Nov 24 07:52:56 PST 2014


On Monday, 24 November 2014 at 15:44:02 UTC, Ramon wrote:
> What is the difference between lazy and eager ranges?
>
> (I guess, the lazy one has not yet queried the elements)

The lazy returns a range that once iterated gives the results one 
at a time (so the function allocates no heap memory).
The eager version creates an array of the results in heap memory.

Bye,
bearophile


More information about the Digitalmars-d-learn mailing list