64-bit integers (long long int) are available on most platforms and frequently used in machine learning data sets as sample IDs, but they are currently read as a string and require parsing.
The library uses std::int64_t and std::uint64_t internally to store integers. There should not be any issue with long long int- in particular, the library will not store numbers as strings. Maybe I misunderstood you.
Here is some example code:
#include "json.hpp"
#include <iostream>
using json = nlohmann::json;
int main()
{
long long int foo = 123123123123;
// store a number without parsing
json j = foo;
// output JSON value
std::cout << j << std::endl;
// roundtrip
long long int j_foo = j;
assert(j_foo == foo);
// parsing creates the same value
assert(json::parse("123123123123") == j);
}
You are right. I just noticed that this datum was in fact a string not a long long int. Sorry for a false alarm.
Most helpful comment
The library uses
std::int64_tandstd::uint64_tinternally to store integers. There should not be any issue withlong long int- in particular, the library will not store numbers as strings. Maybe I misunderstood you.Here is some example code: