Skip to content

JSON for Modern C++ version 3.5.0

Compare
Choose a tag to compare
@nlohmann nlohmann released this 21 Dec 23:03
· 1710 commits to develop since this release
db53bda

Release date: 2018-12-22
SHA-256: 8a6dbf3bf01156f438d0ca7e78c2971bca50eec4ca6f0cf59adf3464c43bb9d5 (json.hpp), 3564da9c5b0cf2e032f97c69baedf10ddbc98030c337d0327a215ea72259ea21 (include.zip)

Summary

This release introduces the support for structured bindings and reading from FILE*. Besides, a few bugs have been fixed. All changes are backward-compatible.

✨ New Features

  • Structured bindings are now supported for JSON objects and arrays via the items() member function, so finally this code is possible:

    for (auto& [key, val] : j.items()) {
        std::cout << key << ':' << val << '\n';
    }

    #1388 #1391

  • Added support for reading from FILE* to support situations in which streams are nit available or would require too much RAM. #1370 #1392

🐛 Bug Fixes

  • The eofbit was not set for input streams when the end of a stream was reached while parsing. #1340 #1343
  • Fixed a bug in the SAX parser for BSON arrays.

⚡ Improvements

  • Added support for Clang 5.0.1 (PS4 version). #1341 #1342

🔨 Further Changes

  • Added a warning for implicit conversions to the documentation: It is not recommended to use implicit conversions when reading from a JSON value. Details about this recommendation can be found here. #1363
  • Fixed typos in the documentation. #1329 #1380 #1382
  • Fixed a C4800 warning. #1364
  • Fixed a -Wshadow warning #1346
  • Wrapped std::snprintf calls to avoid error in MSVC. #1337
  • Added code to allow installation via Meson. #1345

🔥 Deprecated functions

This release does not deprecate any functions. As an overview, the following functions have been deprecated in earlier versions and will be removed in the next major version (i.e., 4.0.0):