I'm writing a program with use of boost::program_option but I can't use one of its feature:
po::options_description desc("Allowed options");
desc.add_options()
("include-path,I", po::value< std::vector<std::string> >(), "include path");
po::variables_map vm;
po::store(po::parse_command_line(argc, argv, desc), vm);
po::notify(vm);
if (vm.count("include-path"))
{
std::cout << "Include paths are: "
<< vm["include-path"].as< std::vector<std::string> >() << "\n";
}
It's pretty the same as in boost.tutorial (http://www.boost.org/doc/libs/1_57_0/doc/html/program_options/tutorial.html)
I Get such error: error: cannot bind ‘std::basic_ostream’ lvalue to ‘std::basic_ostream&&’ std::cout << "Include paths are: " << vm["include-path"].as>() << std::endl;
I've read some topics such as: error: cannot bind ‘std::basic_ostream’ lvalue to ‘std::basic_ostream&&’ Overloading operator<<: cannot bind lvalue to ‘std::basic_ostream&&’
But I don't see connection with my problem. My platform: Fedora 20, Gcc 4.8.3, boost_1_57_0, I'm using -std=c++11 flat to compile code.