cómo obtener boost json para usar los tipos de datos correctos
Cuando yoput_value
usando un int, se escribe como una cadena. ¿Alguien sabe cómo imprimirlo como int?
#include <iostream>
#include <boost/property_tree/ptree.hpp>
#include <boost/property_tree/json_parser.hpp>
using boost::property_tree::ptree;
using namespace std;
int main(int argc, char* argv[]) {
ptree node;
node.put("string", "text here");
node.put("int", 1);//outputs as "1" and should be 1
write_json(cout, node, false);//{"string":"text here","int":"1"}
return 0;
}