
Considering also that neither typedef boost::array<double, 2> array_t; boost::function<double (const array_t&)> f = _1[0]; nor typedef boost::array<double, 2> array_t; boost::function<double (array_t)> f = _1[0]; works, I think there seems to be a patch for lambda to make it more boost::array friendly and more const-aware. Is it theoriotically possible? Thanks for attention. B/Rgds Max
I don't know why this version works
std::vector<Real> vec(2); vec[0] = 1; vec[1] = 2; boost::function<Real (std::vector<Real>)> vec_f = _1[0]; //Returns
the
0'th element. boost::function<Real (std::vector<Real>)> vec_f1 = _1[0] * _1[1];
but this one doesn't.
std::vector<Real> vec(2); vec[0] = 1; vec[1] = 2; boost::function<Real (const std::vector<Real>&)> vec_f = _1[0]; //Returns the 0'th element. boost::function<Real (const std::vector<Real>&)> vec_f1 = _1[0] * _1[1];
B/Rgds Max