diff --git a/docs/mkdocs/docs/home/exceptions.md b/docs/mkdocs/docs/home/exceptions.md index 94b554cbf..00355333c 100644 --- a/docs/mkdocs/docs/home/exceptions.md +++ b/docs/mkdocs/docs/home/exceptions.md @@ -909,7 +909,7 @@ double-precision number when `number_float_t` is `#!cpp float`. An integer number cannot be represented by the binary format it is serialized to: - [BON8](../features/binary_formats/bon8.md) only stores integers that fit into int64. -- [CBOR](../features/binary_formats/cbor.md), [MessagePack](../features/binary_formats/msgpack.md), and +- [CBOR](../features/binary_formats/cbor.md), [MessagePack](../features/binary_formats/messagepack.md), and [BSON](../features/binary_formats/bson.md) store integers in at most 64 bits. With the default number types, every integer fits, but a [`number_integer_t`](../api/basic_json/number_integer_t.md) or [`number_unsigned_t`](../api/basic_json/number_unsigned_t.md) wider than 64 bits (e.g., `__int128`) can hold values diff --git a/include/nlohmann/detail/output/binary_writer.hpp b/include/nlohmann/detail/output/binary_writer.hpp index 1bc4e1339..179e45ed3 100644 --- a/include/nlohmann/detail/output/binary_writer.hpp +++ b/include/nlohmann/detail/output/binary_writer.hpp @@ -933,7 +933,7 @@ class binary_writer static_cast(number); // unused when JSON_NOEXCEPTION is defined static_cast(format_name); static_cast(range); - JSON_THROW(out_of_range::create(407, concat("integer number ", std::string(number.begin(), number.end()), " cannot be represented by ", format_name, " as it does not fit ", range), &j)); + JSON_THROW(out_of_range::create(407, concat("integer number ", number, " cannot be represented by ", format_name, " as it does not fit ", range), &j)); } void write_msgpack_array_prefix(const std::size_t N, const BasicJsonType& j) diff --git a/single_include/nlohmann/json.hpp b/single_include/nlohmann/json.hpp index f8c1a5763..bcf7f7a4c 100644 --- a/single_include/nlohmann/json.hpp +++ b/single_include/nlohmann/json.hpp @@ -22552,7 +22552,7 @@ class binary_writer static_cast(number); // unused when JSON_NOEXCEPTION is defined static_cast(format_name); static_cast(range); - JSON_THROW(out_of_range::create(407, concat("integer number ", std::string(number.begin(), number.end()), " cannot be represented by ", format_name, " as it does not fit ", range), &j)); + JSON_THROW(out_of_range::create(407, concat("integer number ", number, " cannot be represented by ", format_name, " as it does not fit ", range), &j)); } void write_msgpack_array_prefix(const std::size_t N, const BasicJsonType& j)