This commit is contained in:
nlohmann
2026-10-03 05:43:12 +00:00
parent 2aaa1d24ef
commit a410b4f40f
741 changed files with 8115 additions and 2252 deletions
+11 -4
View File
@@ -20,15 +20,15 @@ To store integer numbers in C++, a type is defined by the template parameter `Nu
## Notes
#### Default type
### Default type
With the default values for `NumberIntegerType` (`std::int64_t`), the default value for `number_integer_t` is `std::int64_t`.
#### Default behavior
### Default behavior
- The restrictions about leading zeros are not enforced in C++. Instead, leading zeros in integer literals lead to an interpretation as an octal number. Internally, the value will be stored as a decimal number. For instance, the C++ integer literal `010` will be serialized to `8`. During deserialization, leading zeros yield an error.
#### Limits
### Limits
[RFC 8259](https://tools.ietf.org/html/rfc8259) specifies:
@@ -42,7 +42,7 @@ When the default type is used, the maximal integer number that can be stored is
As this range is a subrange of the exactly supported range [INT64_MIN, INT64_MAX], this class's integer type is interoperable.
#### Storage
### Storage
Integer number values are stored directly inside a `basic_json` type.
@@ -71,6 +71,13 @@ Output:
true
```
## See also
- [number_unsigned_t](https://json.nlohmann.me/api/basic_json/number_unsigned_t/index.md) the type used to store JSON unsigned integer numbers
- [number_float_t](https://json.nlohmann.me/api/basic_json/number_float_t/index.md) the type used to store JSON floating-point numbers
- [is_number_integer](https://json.nlohmann.me/api/basic_json/is_number_integer/index.md) checks whether the JSON value is a signed integer number
- [Number Handling](https://json.nlohmann.me/features/types/number_handling/index.md) - the article on number handling
## Version history
- Added in version 1.0.0.