[program_options] Possible to compose notifier to void void function?

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. Thank ye... Regards, Michael Powell

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
participants (2)
-
Lars Viklund
-
Michael Powell