Link This link fixes a problem.
This is due to a change in the promotion code, because of this I tried another alternative. My solution includes regular expressions:
std::string JSONObject::toString() const { boost::regex exp("\"(null|true|false|[0-9]+(\\.[0-9]+)?)\""); std::stringstream ss; boost::property_tree::json_parser::write_json(ss, *pt); std::string rv = boost::regex_replace(ss.str(), exp, "$1"); return rv; }
I am mainly looking for keywords: true, false, null and any type of number. Matches are replaced with the same without quotes.
source share