12 Jul
2008
12 Jul
'08
2:38 p.m.
James Sutherland:
I can create the multiply function as
boost::function
mult(_1*_2); But now how do I create a "F1" function "h" such that h(t) = f(t)*g(t)?
bind( mult, bind( f, _1 ), bind( g, _1 ) ) creates h(t) = mult( f(t), g(t) ).
I want to do something like:
F1 h = bind( mult, f, g, _1 );
This creates h(t) = mult( f, g, t ).
or
F1 h = bind( mult, bind(f,_1), bind(g,_1), _1 );
This creates h(t) = mult( f(t), g(t), t ). _1 represents the first free argument, 't' in your notation.