Best properly way to destroy a 2 dimensional array?
Alex Parrill via Digitalmars-d-learn
digitalmars-d-learn at puremagic.com
Wed Apr 6 14:33:14 PDT 2016
On Wednesday, 6 April 2016 at 19:54:32 UTC, Jonathan Villa wrote:
> I wrote a little program that given some number it generates a
> list of different combinations (represented by a ubyte array),
> so in the end my function with name GenerateCombinations(int x)
> returns a ubyte[][] (list of arrays of ubytes).
>
> ...
Why not make a range instead? No need to reserve memory for the
entire array if you can compute the elements as-needed.
If you really want an array, std.experimental.allocator will let
you manually allocate/release objects.
More information about the Digitalmars-d-learn
mailing list