A C++20 library for fast serialization, deserialization and validation using reflection. Supports JSON, BSON, CBOR, flexbuffers, msgpack, TOML, XML, YAML / msgpack.org[C++20]
While trying to parse an unordered map (and I assume the behavior would be the same with a regular map), we were getting an exception.
Error when loading a character: Failed to parse field 'visits': Found 27 errors:
1) Failed to parse field '2636585985': stoi argument out of range
2) Failed to parse field '2660778562': stoi argument out of range
...
The is integral call will succeed on 64bit int, regardless of whether they are signed or not, but then pass it into a function that expects a 32 bit value.
I would assume the best solution here is to have an extra if that checks if the size is 8 bytes and calls std::stoull instead.
While trying to parse an unordered map (and I assume the behavior would be the same with a regular map), we were getting an exception.
After looking around the code, I found the call that is erroring out: https://github.com/getml/reflect-cpp/blob/b5338f014203fb161756adf91687b35b936a18b6/include/rfl/parsing/MapReader.hpp#L45
The is integral call will succeed on 64bit int, regardless of whether they are signed or not, but then pass it into a function that expects a 32 bit value.
I would assume the best solution here is to have an extra if that checks if the size is 8 bytes and calls
std::stoull
instead.