|
Boost Users : |
Subject: Re: [Boost-users] A question on if_then_else in lambda.Can any one with kindness help me?
From: Steven Watanabe (watanabesj_at_[hidden])
Date: 2009-06-29 20:27:51
AMDG
fmingu wrote:
> I use Dev-c++, and found a problem:
> # indcude "boost/lambda/if
> ...............
> typedef std::map<int, int> IIPrimemap;
> IIPrimemap primemapvec;
> .......................
> int nnumber;
> int switchvalue;
> ........................
> if_then_else(var(nnumber)==1,var(switchvalue)=1,
> if_then_else(count_if(primemapvec.begin(),primemapvec.end(),
> bind(&IIPrimemap::value_type::second,_1)>2)>0,
> var(switchvalue)=2,var(switchvalue)=3));
> ........................
> But the complier told me that:
>
> no matching function for call to `if_then_else(bool, const
> boost::lambda::lambda_functor<boost::lambda::lambda_functor_base<boost::lambda::other_action<boost::lambda::assignment_action>,
> I do not know how to handle it.
> Can any one with knidness help me?
>
if_then_else is only overloaded to take a lambda expression.
try if_then_else(boost::lambda::constant(count_if(...)), ..., ...)
In Christ,
Steven Watanabe
Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net