|
Boost Users : |
From: James Sutherland (James.Sutherland_at_[hidden])
Date: 2008-07-11 19:17:09
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?
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