Re: std.algorithm Map using a external variable

2012-12-10 Thread Zardoz
Well. I just try it again and I noticed this things : -Changind the lambda function from : auto caca2 = map!((a) {return a * iDeltaT;})(caca); to : auto caca2 = map!((a) {return a + iDeltaT;})(caca); Avoid the segmentation fault -Using dmd 2.60 avoid the segmentation fault. The source code

Re: std.algorithm Map using a external variable

2012-12-10 Thread Maxim Fomin
On Monday, 10 December 2012 at 18:21:48 UTC, Zardoz wrote: I'm trying to use Map with a code like this : ... immutable int m = 10; int[] caca = [1,2,3,4]; auto caca2 = map!( (a) {return a * m;})(caca); writeln(caca2); ... I get a Segmentation fault some times: The most interesting poi

Re: std.algorithm Map using a external variable

2012-12-10 Thread H. S. Teoh
On Mon, Dec 10, 2012 at 07:21:47PM +0100, Zardoz wrote: > I'm trying to use Map with a code like this : > > ... > immutable int m = 10; > int[] caca = [1,2,3,4]; > > auto caca2 = map!( (a) {return a * m;})(caca); > > writeln(caca2); > ... > > I get a Segmentation fault some times: > The

Re: std.algorithm Map using a external variable

2012-12-10 Thread Jacob Carlborg
On 2012-12-10 19:21, Zardoz wrote: I'm trying to use Map with a code like this : ... immutable int m = 10; int[] caca = [1,2,3,4]; auto caca2 = map!( (a) {return a * m;})(caca); writeln(caca2); ... I get a Segmentation fault some times: The most interesting point it's that depends

std.algorithm Map using a external variable

2012-12-10 Thread Zardoz
I'm trying to use Map with a code like this : ... immutable int m = 10; int[] caca = [1,2,3,4]; auto caca2 = map!( (a) {return a * m;})(caca); writeln(caca2); ... I get a Segmentation fault some times: The most interesting point it's that depends of the code around of it ins the same