Boost logo

Boost Users :

Subject: Re: [Boost-users] commandline args
From: Shaolin (shaolinfinest_at_[hidden])
Date: 2009-08-23 19:48:53


Ok, so how do I print the results ?

2009/8/23 Steven Watanabe <watanabesj_at_[hidden]>

> AMDG
>
> Shaolin wrote:
>
>> I have constructed some code but am getting some errors. I am trying to
>> use
>> a vector to hold several values but everytime I execute it I get a page
>> worth of errors. Code below:
>>
>> po::options_description desc("Available Options");
>> desc.add_options()
>> ("file", po::value< vector<string> >(), "specify files to search")
>> ;
>>
>> po::variables_map vm;
>> po::store(po::parse_command_line(ac, av, desc), vm);
>> po::notify(vm);
>>
>> if (vm.count("file")) {
>> cout << "Files selected: " << vm["file"].as< vector<string> >() <<
>> "\n";
>> } else {
>> cout << "No Files selected.\n";
>> }
>>
>> The error is being caused by the following line:
>>
>> cout << "Files selected: " << vm["file"].as< vector<string> >() << "\n";
>>
>>
>
> The standard library doesn't provide output operators
> for containers.
>
> In Christ,
> Steven Watanabe
>
>
> _______________________________________________
> Boost-users mailing list
> Boost-users_at_[hidden]
> http://lists.boost.org/mailman/listinfo.cgi/boost-users
>



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