Does anyone have an idea why the following doesn't compile: using lambda::_1; using lambda::_2; boost::function<double (const boost::array<double, 2>&)> f = lambda::ret<double>(_1[0] * _1[1]);
I'm not sure about this, but you might try
boost::function<double (const boost::array<double, 2>&)> f = lambda::ret<double>( var(_1)[0]*var(_1)[1] );
Also, I don't know if you need the ret<double> bit.