confused with data types

JN 666total at wp.pl
Sat Feb 17 16:43:37 UTC 2018


On Saturday, 17 February 2018 at 16:12:48 UTC, thorstein wrote:
> Hello,
>
> This was my goal:
> -----------------
> public double[][] skalar_m_2d(double[][] array, double skalar)
> {
>   return array.map!(b => b[].map!(c => c * skalar));
> }
>
> !!! But: return value is not double!
>
> Type check for return value:
> ----------------------------
> a = array.map!(b => b[].map!(c => c * skalar))
> writeln(typeof(a).stringof); //-> MapResult!("__lambda4, 
> double[][])
>
> a = array.map!(b => b[].map!(c => c * skalar))[1];
> writeln(typeof(a).stringof); //-> MapResult!("__lambda2, 
> double[])
>
> How can I get the result as double[][] ???
>
> Thanks, thorstein

I'm no expert, but importing std.array and doing a.array() should 
work.


More information about the Digitalmars-d-learn mailing list