#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';
}
I don't understand why this code is not printing. As there could be many server.url entries, I was trying to access them using equal_range
.