avoiding loops, allocation using arrays and ranges

Danni Coy via Digitalmars-d digitalmars-d at puremagic.com
Mon Mar 28 01:13:08 PDT 2016


>     writeln(v.array); // everything gets eval by .array

.array allocates a new array. I want to store the result of v in a
buffer that I have preallocated
in my case this just happens to be a[];

This is quite important.
This is also the step I would like a more elegant way to deal with.

> There's probably some interesting stuff that covers this in std.range. Look
> at the functions that take some "Range Of Ranges" (RoR) as parameter. like
> transpose, transversal, etc.

Thank you I will certainly take a look at these.


More information about the Digitalmars-d mailing list