Skip to content

Releases: shiruixuan/json

JSON for Modern C++ version 3.10.5

15 Sep 01:42
4f8fba1
Compare
Choose a tag to compare

Release date: 2022-01-03
SHA-256: e832d339d9e0c042e7dff807754769d778cf5d6ae9730ce21eed56de99cb5e86 (json.hpp), b94997df68856753b72f0d7a3703b7d484d4745c567f3584ef97c96c25a5798e (include.zip)

Summary
The previous version 3.10.4 introduced support to convert std::filesystem objects to JSON and vice versa. Unfortunately, we made the assumption that any compiler supporting C++17 would also have proper filesystem support. This was a mistake. This release introduces preprocessor checks (and means to override them) to make sure that the conversion support is only compiled if the compiler is detected to support it.

All changes are backward-compatible.

moneybag Note you can support this project via GitHub sponsors or PayPal.

bug Bug fixes
Make sure C++17 filesystem conversions are only used if the compiler supports it. Furthermore, add defines JSON_HAS_FILESYSTEM and JSON_HAS_EXPERIMENTAL_FILESYSTEM which can be set to 0 to avoid using filesystem support altogether.std::filesystem. nlohmann#3090 nlohmann#3097 nlohmann#3101 nlohmann#3156 nlohmann#3203
Fix a compilation error with Nvidia CUDA Compiler (NVCC). nlohmann#3013 nlohmann#3234
Warnings
Fix a warning for shadowed variables. nlohmann#3188 nlohmann#3193
Fix a warning on a pointless comparison. nlohmann#3227 nlohmann#2712 nlohmann#2676 nlohmann#1390 nlohmann#755
zap Improvements
Add a parameter to the update function to recursively merge objects with common keys. nlohmann#3006 nlohmann#3069
Extend std::hash and std::swap to work on any nlohmann::basic_json specializations rather than just nlohmann::json. nlohmann#3121
hammer Further Changes
Tests and CI
Update CI to use Clang 14, GCC 6, and Clang-Tidy 14. nlohmann#3088
Update cpplint. nlohmann#3225
Add build step for the Nvidia CUDA Compiler (NVCC). nlohmann#3227
Remove Travis CI. nlohmann#3087 nlohmann#3233
Compile and execute the test suite with C++17. nlohmann#3101
Documentation
The mkdocs-based documentation in doc/mkdocs has been totally overworked. It now has a unified structure, more examples, and contains all information from the previous Doxygen-based documentation. The single source of truth is now the documentation on https://json.nlohmann.me/ and in particular the API Documentation. nlohmann#3071
Removed Wandbox online examples. nlohmann#3071
Fix typos, links, and parameter names in the documentation. nlohmann#3102 nlohmann#3125 nlohmann#3140 nlohmann#3145 nlohmann#3148
Add more examples. nlohmann#3071 nlohmann#3100
fire Deprecated functions
Passing iterator pairs or pointer/length pairs to parsing functions (basic_json::parse, basic_json::accept, basic_json::sax_parse, basic_json::from_cbor, basic_json::from_msgpack, basic_json::from_ubjson, basic_json::from_bson) via initializer lists is deprecated. Instead, pass two iterators; for instance, call basic_json::from_cbor(ptr, ptr+len) instead of basic_json::from_cbor({ptr, len}).

The following functions have been deprecated in earlier versions and will be removed in the next major version (i.e., 4.0.0):

Function iterator_wrapper are deprecated. Please use the member function items() instead.
Functions friend std::istream& operator<<(basic_json&, std::istream&) and friend std::ostream& operator>>(const basic_json&, std::ostream&) are deprecated. Please use friend std::istream& operator>>(std::istream&, basic_json&) and friend operator<<(std::ostream&, const basic_json&) instead.
All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.