Skip to content

JSON for Modern C++ version 3.10.5

Compare
Choose a tag to compare
@nlohmann nlohmann released this 03 Jan 05:41
· 302 commits to develop since this release
4f8fba1

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.

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

🐛 Bug fixes

Warnings

⚡ Improvements

  • Add a parameter to the update function to recursively merge objects with common keys. #3006 #3069
  • Extend std::hash and std::swap to work on any nlohmann::basic_json specializations rather than just nlohmann::json. #3121

🔨 Further Changes

Tests and CI

  • Update CI to use Clang 14, GCC 6, and Clang-Tidy 14. #3088
  • Update cpplint. #3225
  • Add build step for the Nvidia CUDA Compiler (NVCC). #3227
  • Remove Travis CI. #3087 #3233
  • Compile and execute the test suite with C++17. #3101

Documentation

🔥 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):

All deprecations are annotated with HEDLEY_DEPRECATED_FOR to report which function to use instead.