
Hello!
I am looking for advice about the use of the "notifier" function in program_options::options_description with class methods. My problem seems very basic to mee, yet I wasn't able to find the (any) related documentation.
Here is a minimal example of what I cannot get to work:
struct test
{
void function(int i) {std::cout << i << std::endl;}
void does_not_compile()
{
po::options_description desc;
desc.add_options()
("option", po::value<int>()->notifier(&test::function), "Option")
;
}
};
Compilation fails with:
[…]
test.cpp:62:82: instantiated from here
/usr/include/boost/function/function_template.hpp:225:11: error: no match for call to '(boost::_mfi::mf1