1 Dec
2010
1 Dec
'10
6:35 p.m.
DeĀ : Robert Jones
How can I write an inline nullary function object, returning a fixed value? The equivalent of this...
int x = 4;
int f( ) { return x; }
boost::function
g = f; but without defining the intermediate f()?
I thought this might work...
boost::function
g = bind(bind(apply<int>(), _1 ), x );
With Lambda, you could write:
boost::function