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