1
我正在使用boost属性树来存储我的应用程序的配置数据。迭代Boost Property Tree中的项目
在配置文件中我有一个名为的项目,看起来像这样。 我想知道我如何迭代ServerList。
ServerList
{
server1 127.0.0.1:5000
server2 example.com
}
通过该解决方案此处提供的方式,似乎并没有为我工作: Boost Property Tree and Xml parsing Problems 所以不要去和那个重新报价。当我尝试它时,我得到这个错误:
config.cpp:47: error: invalid initialization of reference of type ‘boost::property_tree::wiptree&’ from expression of type ‘boost::property_tree::basic_ptree<std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::basic_string<char, std::char_traits<char>, std::allocator<char> >, std::less<std::basic_string<char, std::char_traits<char>, std::allocator<char> > > >’
make: *** [config.o] Error 1
显示您的代码。 – Abyx 2010-10-11 07:36:12