Boost logo

Boost Users :

From: Vladimir Prus (vladimir_at_[hidden])
Date: 2008-08-08 08:42:08


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


Boost-users list run by williamkempf at hotmail.com, kalb at libertysoft.com, bjorn.karlsson at readsoft.com, gregod at cs.rpi.edu, wekempf at cox.net