Boost logo

Boost Users :

From: Susan Flynn (imadveng_at_[hidden])
Date: 2005-05-11 07:18:54

I'm new to boost (and c++) and I've just started
using program_options. Great concept and code, it has
saved me a lot of time/effort, thanks.

I am having a problem with the
->notify(&your_function) in add_options. I get
a compile error (g++ on redhat):
"invalid use of void expression".
If I comment out the ->notify(&func) part, the code
compiles. This is the code:

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");
         po::value< string >()
            ->notify( &Report::PrintName))
  ...catch code...

Any help/ideas appreciated. I'm hoping it's something
simple and my lack of c++ knowledge is showing. I've
already simplified the code and tried several
modifications, but the compile error persists.


Do you Yahoo!?
Yahoo! Mail - You care about security. So do we.

Boost-users list run by williamkempf at, kalb at, bjorn.karlsson at, gregod at, wekempf at