i've got a variable:
boost::program_options::options_description m_corbaDesc;
and the following is done with it
开发者_如何学运维m_corbaDesc.add_options()
("corba", boost::programm_options::parameter("<options+>", &m_corbaOptions), "CORBA -ORBInitRef options")
("corba-ns", boost::program_options::parameter("<name:port>", &m_corbaNameService), "simple-type CORBA NameService").default_value("localhost:12345")
;
this works in boost boost 1.33.1 but not in 1.42.0.
What would it be in 1.42.0?
I am not actually sure Boost.ProgramOptions ever had anything named parameter -- I think it was naming in the reviewed version, and was changed before it was added to SVN.You should use something like:
m_corbaDesc.add_options()
("corba", po::value(&m_corbaOptions), "CORBA -ORBInitRef options")
("corba-ns", po::value(&m_corbaNameService)->default_value("localhost:12345"),
"simple-type CORBA NameService")
;
and the documentation describes the current syntax anyway. Does this help?
精彩评论