11 Jul
2008
11 Jul
'08
11:17 p.m.
On Jul 11, 2008, at 1:52 PM, Steven Watanabe wrote:
f3 takes 3 arguments, so you need to pass a third argument to bind. F2arg f2 = bind<double>( f3, _1, x2, _2);
f2(5, 6) // calls f3(5.0, x2, 6.0)
What if I wanted to do something like: int main() { using namespace boost; using namespace lambda; typedef function< double() > F0arg; const double x1=1.1, x2=2.2; F0arg f = bind( ret<double>(_1*_2)(x1,x2) ); } Or, slightly more generally, if we want to bind other boost::function objects and not POD: typedef function< double(T) > Func; Func func1, func2; ... F0arg f = bind( ret<double>(_1*_2)(func1,func2) ); Any ideas here?