I'm familiarizing myself with boost::program_options
(and C++ in general). I wrote the function below, but I can't quite understand the error I'm getting. Here's the code (note that po
is an alias for boost::program_options
).
int application(po::variables_map& vm)
{
std::cout << &vm << std::endl;
std::cout << vm["infile"];
return SUCCESS;
}
The error I'm receiving is for the second line in the function body. It reads: "no match for ‘operator<<’ (operand types are ‘std::ostream {aka std::basic_ostream<char>}’ and ‘const boost::program_options::variable_value’)"
What am I doing wrong?