Boost logo

Boost Users :

Subject: [Boost-users] A question on switch_statement. Can any one with kindness help me?
From: fmingu (fmingu_at_[hidden])
Date: 2009-07-04 23:12:36


I am using Dev-C++ with boost lambda expression, and I wrote the following lines:
................
int result,switchvalue;
..............
 (switch_statement(_1,
   case_statement<1>
   (var(result)=0),
   case_statement<2>
   (var(result)=1),
   case_statement<3>
     (var(result)=constant(value)),
   default_statement
            (var(std::cout)<<"wrong")
   ))(switchvalue);

but the complier told me that:
  instantiated from `Arg::sig<boost::tuples::tuple<A&, B&, C&, Env&, boost::tuples::null_type, boost::tuples::null_type,..........
 
  instantiated from `RET boost::lambda::lambda_functor_base<boost::lambda::switch_action<5, boost::lambda::detail::case_label<Case0>, ....................
 
  instantiated from `T::sig<boost::tuples::tuple<A&, boost::tuples::null_type, boost::tuples::null_type, .........
 
  instantiated from here
 
And I do not know where is wrong and how to correct it.
By the way, can I use make_const(switchvalue) or constant(switchvalue)
instead of switchvalue?
Can any one with kindness help me?



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