boost program options - notifier function 0 arguments

Hello I've been wondering how its possible to call a notifier function with an option that doesnt require arguments. Something like: po::options_description desc("Allowed options"); desc.add_options() ("help", po::value<>()->notifier(&_help_function), "produce help message"); Whats the proper way of doing this? Many thanks in advance Aljaz

Aljaz wrote:
Hello
I've been wondering how its possible to call a notifier function with an option that doesnt require arguments.
Something like: po::options_description desc("Allowed options"); desc.add_options() ("help", po::value<>()->notifier(&_help_function), "produce help message"); Whats the proper way of doing this?
("help", po::value<>()->notifier(boost::bind(_help_function)), "produce help The functional object produced by boost::bind will take any number of arguments, up to a fixed amount, and will discard those that the wrapped function would not take. - Volodya
participants (2)
-
Aljaz
-
Vladimir Prus