【发布时间】:2015-04-17 08:16:03
【问题描述】:
#include <boost/property_tree/ptree.hpp>
#include <string>
#include <iostream>
int main()
{
boost::property_tree::ptree ptree;
const std::string entry = "server.url";
ptree.add( entry, "foo.com" );
auto range = ptree.equal_range( entry );
for( auto iter = range.first ; iter != range.second ; ++iter )
std::cout << iter->first << '\n';
}
我不明白为什么这段代码没有打印出来。由于可能有许多 server.url 条目,我试图使用 equal_range 访问它们。
【问题讨论】:
标签: c++ boost boost-propertytree equal-range