Skip to content

JSON for Modern C++ Version 2.1.0

Compare
Choose a tag to compare
@nlohmann nlohmann released this 28 Jan 17:44
· 3101 commits to develop since this release
  • Release date: 2017-01-28
  • SHA-256: a571dee92515b685784fd527e38405cf3f5e13e96edbfe3f03d6df2e363a767b

Summary

This release introduces a means to convert from/to user-defined types. The release is backwards compatible.

conversion

Changes

  • ✨ The library now offers an elegant way to convert from and to arbitrary value types. All you need to do is to implement two functions: to_json and from_json. Then, a conversion is as simple as putting a = between variables. See the README for more information and examples.
  • Exceptions can now be switched off. This can be done by defining the preprocessor symbol JSON_NOEXCEPTION or by passing -fno-exceptions to your compiler. In case the code would usually thrown an exception, abort() is now called.
  • Information on the library can be queried with the new (static) function meta() which returns a JSON object with information on the version, compiler, and platform. See the documentation for an example.
  • 🐛 A bug in the CBOR parser was fixed which led to a buffer overflow.
  • ✨ The function type_name() is now public. It allows to query the type of a JSON value as string.
  • ✅ Added the Big List of Naughty Strings as test case.
  • ⬆️ Updated to Catch v1.6.0.
  • 📝 Some typos in the documentation have been fixed.