开发者

Problem porting boost 1.33.1 programm to boost 1.42.0

开发者 https://www.devze.com 2022-12-27 07:15 出处:网络
i\'ve got a variable: boost::program_options::options_description m_corbaDesc; and the following is done with it

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?

0

精彩评论

暂无评论...
验证码 换一张
取 消