
23 Nov
2009
23 Nov
'09
5:51 p.m.
maruthilakshman-boost@yahoo.com wrote: ...
I was hoping that if I have a twoarg_callback(int, int) function, I can register it with the module by using boost::bind to bind the first argument, but that is not possible. I am unable to assign the return value of boost::bind to a boost::function<void (int)> object by binding one argument.
Use boost::bind( twoarg_callback, 3, _1 ). The 'int' in function<void(int)> is the first argument and is addressed via _1. There is no second argument, so _2 doesn't work.