Finally full multidimensional arrays support in D

Stefan Frijters via Digitalmars-d digitalmars-d at puremagic.com
Wed Jun 11 12:20:19 PDT 2014


On Tuesday, 10 June 2014 at 19:04:18 UTC, Stefan Frijters wrote:
> I've been using the multidimensional arrays for a while now, 
> but recently I've run into a problem w.r.t. optimization:
>
> import std.stdio;
> import unstd.multidimarray;
>
> void main() {
>   MultidimArray!(double, 3) arr;
>   arr = multidimArray!double([1,2,42]);
>   writeln(arr.lengths);
> }
>
> If I compile with 'dmd multidimtest.d unstd/multidimarray.d', I 
> get [1,2,42], as expected, but when I compile in release mode 
> 'dmd multidimtest.d unstd/multidimarray.d -release' I get 
> [0,0,0]. Any ideas what might cause this?

I've looked into this and it seems there is required code inside 
a contract 'in', which is omitted with -release.

I've gone ahead and opened a pull request to fix this: 
https://bitbucket.org/denis-sh/unstandard/pull-request/2/bugfixes-for-multidimarrayd

Stefan


More information about the Digitalmars-d mailing list