
13 Apr
2013
13 Apr
'13
6:10 a.m.
On Fri, Apr 12, 2013 at 05:51:00PM -0500, Michael Powell wrote:
Hello,
Is it possible? Something like the example identified here:
http://stackoverflow.com/questions/7125666/what-is-boostprogram-optionsnotif...
Except I'd like to hook up a void(void) notifier handler instead of the parameter.
notifier(f) expects anything callable with signature void(T). A simple way of making a callable that can take more arguments is to use boost::bind (or assumedly std::bind if you're fancy). The callable that bind returns ignores any unused arguments, which in the case of not having any placeholders at all is all of them. void f() { std::cerr << "meep meep"; } function<void (int,int,int)> fun = bind(&f); fun(42, 3, 5); -- Lars Viklund | zao@acc.umu.se