std.algorithm Map using a external variable
    Jacob Carlborg 
    doob at me.com
       
    Mon Dec 10 10:50:16 PST 2012
    
    
  
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 of the code around of it
> ins the same  program. for example If a use getopt at the begin of my
> program, then seg fault, etc...
>   Looks that there some weird error in gdc 4.6.3
>
> PD: Later I will put the whole code so any can see if I doing some weird
> thing that make map crazy
std.getopt uses module variables, don't know if that has anything to do 
with it.
-- 
/Jacob Carlborg
    
    
More information about the Digitalmars-d-learn
mailing list