JSON for Modern C++ version 3.7.0
Release date: 2019-07-28
SHA-256: a503214947952b69f0062f572cb74c17582a495767446347ce2e452963fc2ca4 (json.hpp), 541c34438fd54182e9cdc68dd20c898d766713ad6d901fb2c6e28ff1f1e7c10d (include.zip)
Summary
This release introduces a few convenience functions and performs a lot of house keeping (bug fixes and small improvements). All changes are backward-compatible.
✨ New Features
- Add overload of the
containsfunction to check if a JSON pointer is valid without throwing exceptions, just like its counterpart for object keys. #1600 - Add a function
to_stringto allow for generic conversion to strings. #916 #1585 - Add return value for the
emplace_backfunction, returning a reference to the added element just like C++17 is introducing this forstd::vector. #1609 - Add info how to use the library with the pacman package manager on MSYS2. #1670
🐛 Bug Fixes
- Fix an issue where typedefs with certain names yielded a compilation error. #1642 #1643
- Fix a conversion to
std::string_viewin the unit tests. #1634 #1639 - Fix MSVC Debug build. #1536 #1570 #1608
- Fix
get_tomethod to clear existing content before writing. #1511 #1555 - Fix a
-Wc++17-extensionswarning.nodiscardattributes are now only used with Clang when-std=c++17is used. #1535 #1551
⚡ Improvements
- Switch from Catch to doctest for the unit tests which speeds up compilation and runtime of the 112,112,308 tests.
- Add an explicit section to the README about the frequently addressed topics character encoding, comments in JSON, and the order of object keys.
🔨 Further Changes
- Use
GNUInstallDirsto set library install directories. #1673 - Fix links in the README. #1620 #1621 #1622 #1623 #1625
- Mention
jsontype on the documentation start page. #1616 - Complete documentation of
value()function with respect totype_error.302exception. #1601 - Fix links in the documentation. #1598
- Add regression tests for MSVC. #1543 #1570
- Use CircleCI for continuous integration.
- Use Doozer for continuous integration on Linux (CentOS, Raspbian, Fedora)
- Add tests to check each CMake flag (
JSON_BuildTests,JSON_Install,JSON_MultipleHeaders,JSON_Sanitizer,JSON_Valgrind,JSON_NoExceptions,JSON_Coverage). - Use Hedley to avoid re-inventing several compiler-agnostic feature macros like
JSON_DEPRECATED,JSON_NODISCARD,JSON_LIKELY,JSON_UNLIKELY,JSON_HAS_CPP_14, orJSON_HAS_CPP_17. Functions taking or returning pointers are annotated accordingly when a pointer will not be null. - Build and run tests on AppVeyor in DEBUG and RELEASE mode.
🔥 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):
- Function
iterator_wrapperare deprecated. Please use the member functionitems()instead. - Functions
friend std::istream& operator<<(basic_json&, std::istream&)andfriend std::ostream& operator>>(const basic_json&, std::ostream&)are deprecated. Please usefriend std::istream& operator>>(std::istream&, basic_json&)andfriend operator<<(std::ostream&, const basic_json&)instead.