This commit is contained in:
nlohmann
2026-09-15 20:47:46 +00:00
parent 7b7abfd224
commit db9042b6ac
306 changed files with 4213 additions and 781 deletions
+4
View File
@@ -14,6 +14,10 @@ This description includes both integer and floating-point numbers. However, C++
To store floating-point numbers in C++, a type is defined by the template parameter `NumberFloatType` which chooses the type to use.
## Template parameters
`NumberFloatType` : the type to store floating-point numbers. Parsing and serialization are implemented in terms of `std::strtof`/`std::strtod`/`std::strtold` and `std::snprintf`, so the type must be `float`, `double`, or `long double`. The [binary formats](https://json.nlohmann.me/features/binary_formats/index.md) additionally require `float` or `double`, because they have no encoding for `long double`. See [Template Parameter Requirements](https://json.nlohmann.me/features/types/template_parameters/#numberfloattype).
## Notes
#### Default type