
12 Jul
2008
12 Jul
'08
1:34 a.m.
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