mirror of
https://github.com/nlohmann/json.git
synced 2026-11-17 17:01:30 +00:00
The subtype of a binary value is a std::uint64_t, but dump() wrote it with dump_integer, which converts its argument to the magnitude type of number_unsigned_t. With a number_unsigned_t narrower than 64 bits, the subtype was truncated (subtype 300 with std::uint8_t numbers was printed as 44). A dump_subtype helper now writes the subtype for both the compact and the pretty-printed output: through dump_integer if the magnitude type of number_unsigned_t has at least 64 bits (the default json, so its output and speed are unchanged), and with a digit loop otherwise. Signed-off-by: Niels Lohmann <mail@nlohmann.me>