boost ptree access first element with no path name
问题 I am using boost library to manipulate a JSON string and I would like to access to a first element. I was wondering if there where some convenient way to access a first element of ptree with no path name. I do this, but I got no value : namespace pt = boost::property_tree; pt::ptree pt2; string json = "\"ok\""; istringstream is(json); try { pt::read_json(is, pt2); cout << pt2.get_child("").equal_range("").first->first.data() << endl; } catch (std::exception const& e) { cerr << e.what() <<