
11 May
2005
11 May
'05
11:57 p.m.
Hi Susan,
void Report::PrintName(const string name) { cout << " the log name is " << name << "\n"; }
void Report::InitCmdOpts(void) { try { p_opts = new po::options_description("Reporting"); p_opts->add_options() ("log", po::value< string >() ->default_value("sys.log") ->notify( &Report::PrintName)) ;
In this context the library expects you to pass a function that takes 'string' and returns nothing. However, you pass a member function, which has implicit 'this' argument. I'd suggest this: #include <boost/bind.hpp> ..... ->notify(boost::bind(&Report::PrintName, this, _1)) HTH, Volodya