#include #include #include #include #include #include struct divdoub_ { template struct result { typedef T type; }; template T operator()(T x, F f) const { T doub = x * x; return f(doub) / 2; } }; boost::phoenix::function const divdoub = divdoub_(); using namespace std; int main(){ { using namespace boost::phoenix; using namespace boost::phoenix::arg_names; double const dos = 2.0; boost::function f = divdoub(_1, lambda[_1+1.0]); cout<< f(dos) << endl; // should return 2.5 } return 0; };