P
pallav
i'm using the boost:rogram_options and i'm having some problems with
syntax: the code in question is the following:
vector<string> opt;
potions_description desc("Usage");
desc.add_options()
("nodes,n", po::value<vector<string> > (&opt)->default_value("*"),
"Name of node(s) to print.")
;
/usr/local/include/boost-1_33_1/boost/program_options/
value_semantic.hpp:152: note: candidates are:
boost:rogram_options::typed_value<T, charT>*
boost:rogram_options::typed_value<T, charT>::default_value(const T&)
[with T = std::vector<std::string, std::allocator<std::string> >,
charT = char]
basically i want to assign the "nodes,n" option a default value of "*"
but i'm not sure what the correct syntax is. i'm trying (&opt)-
string opt;
desc.add_options()
("nodes,n" po::value<sring> (&opt)->default_value("some string"),
"Names of node(s) to print")
what about if i want to make opt a vector<string>? any ideas will be
appreciated.
thanks
syntax: the code in question is the following:
vector<string> opt;
potions_description desc("Usage");
desc.add_options()
("nodes,n", po::value<vector<string> > (&opt)->default_value("*"),
"Name of node(s) to print.")
;
/usr/local/include/boost-1_33_1/boost/program_options/
value_semantic.hpp:152: note: candidates are:
boost:rogram_options::typed_value<T, charT>*
boost:rogram_options::typed_value<T, charT>::default_value(const T&)
[with T = std::vector<std::string, std::allocator<std::string> >,
charT = char]
basically i want to assign the "nodes,n" option a default value of "*"
but i'm not sure what the correct syntax is. i'm trying (&opt)-
this:default_value("*") but this works if it were a string. i.e. like
string opt;
desc.add_options()
("nodes,n" po::value<sring> (&opt)->default_value("some string"),
"Names of node(s) to print")
what about if i want to make opt a vector<string>? any ideas will be
appreciated.
thanks