.dup with twodimensional arrays

berni someone at somemail.de
Wed Mar 21 10:56:21 UTC 2018


On Wednesday, 21 March 2018 at 10:26:03 UTC, Steven Schveighoffer 
wrote:
> import std.algorithm: map;
> import std.array: array;
>
> solutions ~= tmp
>    .map!(a => a.dup) // every access to an element dups it first
>    .array;           // build an array out of the result

Oh, thanks, that's already better. (And with ldc it's much 
faster, saves about half of the time).


More information about the Digitalmars-d mailing list