What is the issue you have?
For number "9223372036854775808" (int64_t::max() + 1) I expects that json.get<nlohmann::json::number_integer_t>() throws exception.
Can you provide a small but working code example?
https://godbolt.org/z/v4ejoPszf
#include "nlohmann/json.hpp"
#include <iostream>
int main(int, char **) {
auto json = nlohmann::json::parse(R"({ "package size": 9223372036854775808 })");
auto [key, number] = *json.items().begin();
std::cout << number.get<nlohmann::json::number_integer_t>() << std::endl;
return 0;
}
What is the expected behavior?
I expects to get exception.
And what is the actual behavior instead?
Program stdout
-9223372036854775808
Which compiler and operating system are you using?
- Compiler: clang-12
- Operating system: Ubuntu, RedHat
Which version of the library did you use?
What is the issue you have?
For number "9223372036854775808" (
int64_t::max()+ 1) I expects thatjson.get<nlohmann::json::number_integer_t>()throws exception.Can you provide a small but working code example?
https://godbolt.org/z/v4ejoPszf
What is the expected behavior?
I expects to get exception.
And what is the actual behavior instead?
Which compiler and operating system are you using?
Which version of the library did you use?
developbranch