« Return to Thread: How can I save the values in lambda expression? Can any one with kindness help me?

Re: How can I save the values in lambda expression? Can any one with kindness help me?

by Steven Watanabe-4 :: Rate this Message:

Reply to Author | View in Thread

AMDG

fmingu wrote:

> I am using Dev-C++ with boost lambda expression, I wrote:
> ....................
> int nnumber;
> int switchvalue;
> typedef std::map<int, int> IIPrimemap;
> IIPrimemap primemapvec;
>  # define BetaKGre2   1
>  # define EqualToOne  2
>  #define  ProductOfKPrime  3
> .....................
>   if_then_else(var(nnumber)==1,var(switchvalue)=EqualToOne,
>   if_then_else(constant(count_if(primemapvec.begin(),primemapvec.end(),
>        bind(&IIPrimemap::value_type::second,_1)>2)>0),
>         var(switchvalue)=BetaKGre2,var(switchvalue)=ProductOfKPrime));
>   std::cout<<" the var(switchvalue) is  "<<var(switchvalue)<<"\n";
> ..............
> and the program ran and showed:
> the var(switchvalue) is
>  
> without any expression of var(switchvalue).
> I do not know how to save the values in lambda expression and where is wrong?
> Can I use *var(switchvalue) instead of var(switchvalue)?
> Can anyone with kindness help me?
>  
Think about it. What exactly is var(switchvalue)?
What does std::cout << var(switchvalue) do?

In Christ,
Steven Watanabe


_______________________________________________
Boost-users mailing list
Boost-users@...
http://lists.boost.org/mailman/listinfo.cgi/boost-users

 « Return to Thread: How can I save the values in lambda expression? Can any one with kindness help me?