I tried to call boost::phoenix::function
based on lambda function with parameters and failed. If I call it without parameters in such a way:
const auto closure = [](){
cout<< "test" << endl;
};
typedef decltype(closure) ClosureType;
const boost::phoenix::function<ClosureType> lazyFunc (std::move(closure));
lazyFunc()();
all compiles nice. But when I declare at least one parameter of lambda:
const auto closure = [](int& param) { cout<<"Test" << param << endl; };
typedef decltype(closure) ClosureType;
const boost::phoenix::function<ClosureType> lazyFunc (std::move(closure));
lazyFunc(arg1)(a);
compilation fails with tremendous stack trace deep inside of boost::result_of