Boost logo

Boost Users :

From: Chris Weed (chrisweed_at_[hidden])
Date: 2006-10-19 01:03:40


Hi,
I would like to create a boost::function to a lambda::bind functor such as

float fx(float a, float b) { return a+b; }

int main()
{
  boost::function<float(float)> f = boost::lambda::bind(fx,_2,2);
  std::cout << f(3) << std::endl;
  return 0;
}

I would expect this to bind 2 to the "b" argument of fx, and print "5".
Instead with msvc-8.0 I get a bunch or compile errors.
Any help would be greatly appreciated.
Chris


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net