B
barcaroller
In the boost:rogram_options tutorial, the author included the following
code:
cout << "Input files are: "
<< vm["input-file"].as< vector<string> >()
<< "\n";
Basically, he is trying to print a vector of string, in one line. I could
not get this compile (let alone run). To get it to compile and run, I had
to re-write it as:
vector<string> v = vm["input-file"].as< vector<string> >();
vector<string>::const_iterator i;
for ( i = v.begin();
i != v.end();
++i )
{
cout << *citer << " ";
}
Does anyone know if the original line of code is correct? If so, what was I
missing?
code:
cout << "Input files are: "
<< vm["input-file"].as< vector<string> >()
<< "\n";
Basically, he is trying to print a vector of string, in one line. I could
not get this compile (let alone run). To get it to compile and run, I had
to re-write it as:
vector<string> v = vm["input-file"].as< vector<string> >();
vector<string>::const_iterator i;
for ( i = v.begin();
i != v.end();
++i )
{
cout << *citer << " ";
}
Does anyone know if the original line of code is correct? If so, what was I
missing?