code:
#include <fstream>
#include <iostream>
#include "nlohmann/json.hpp"
using nlohmann::json;
int main()
{
std::ifstream file("Test.json");
json j = json::parse(file);
std::cout<<j["a"].is_number_integer()<<std::endl;
}
json file:
{ "a":1 }
when use icc compiler(icc (ICC) 19.1.0.139 20191004) compile code, the result of json is_number_integer() function is 0, its obviously a wrong result.
However, when I use gcc compiler the result is right.
Platform :Linux version 3.10.0-1062.1.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) )
code:
json file:
{ "a":1 }when use icc compiler(icc (ICC) 19.1.0.139 20191004) compile code, the result of json is_number_integer() function is 0, its obviously a wrong result.
However, when I use gcc compiler the result is right.
Platform :Linux version 3.10.0-1062.1.2.el7.x86_64 (mockbuild@kbuilder.bsys.centos.org) (gcc version 4.8.5 20150623 (Red Hat 4.8.5-39) (GCC) )