Boost logo

Boost Users :

From: James Sutherland (James.Sutherland_at_[hidden])
Date: 2008-07-11 21:34:09


I know I am probably trying patience of the readers here, but I have
one more question.

Suppose I have something like

   typedef boost::function< double(double) > F1;
   F1 f;
   F1 g;

and I want to create a function that takes a single argument "t" and
produces f(t)*g(t). I can create the multiply function as

   boost::function<double(double,double)> mult(_1*_2);

But now how do I create a "F1" function "h" such that h(t) =
f(t)*g(t)? I want to do something like:

   F1 h = bind( mult, f, g, _1 );

or

   F1 h = bind( mult, bind(f,_1), bind(g,_1), _1 );

but these aren't working...

Any tips would be greatly appreciated...

James


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