range chunks

Steven Schveighoffer schveiguy at yahoo.com
Fri Aug 6 10:48:49 PDT 2010

On Fri, 06 Aug 2010 13:33:09 -0400, Philippe Sigaud  
<philippe.sigaud at gmail.com> wrote:

> Here is what I cooked, it's still a bit rough around the edges. It has an
> optional step argument, to see how many elements to jump.


>     ElementType!R[] front() @property { return array(take(range, n));} //

I'd change this to just return take(range, n).  Rule #1 in writing  
efficient D code, avoid the heap when you can :)


More information about the Digitalmars-d mailing list