Consider the following piece of C++0x code:
a_signal.connect([](int i) {
if(boost::any_cast<std::string>(_buffer[i]) == "foo")
{
base_class<>* an_object = new derived_class();
an_object->a_method(_buffer[i]);
}});
How would it correctly look in Boost Lambda (since this C++0x feature can’t be used in GCC 4.4 yet)?
I think this should work:
bind,if_then,ll_static_cast,new_ptr,_1,var(and, i thinkreftoo) are members ofboost::lambda.But honestly, i would refuse to work with such code, personally 🙂