How do I pass multidimensional static arrays to functions expecting

Timon Gehr timon.gehr at gmx.ch
Tue Aug 30 02:28:26 PDT 2011


On 08/30/2011 03:20 AM, bearophile wrote:
> Timon Gehr:
>
>> bar(array(map!((int[] a){return a;})(multi[])));
>
> Simpler:
> bar( array(map!q{ a[] }(multi[])) );

And buggy. It returns slices of a local stack frame, because static 
arrays are value types.

>
> Simpler still when we'll get amap:
> bar( amap!q{ a[] }(multi[]) );
>
> Bye,
> bearophile



More information about the Digitalmars-d-learn mailing list