JSON for Modern C++ 3.2.0 已发布,此版本引入了 SAX 接口。虽然这可能只是少数人使用的一个非常特殊的功能,但它允许统一所有消耗输入并创建某种 JSON 值的函数。 此外,新版支持从宽字符串类型进行解析。这是将库从 UTF-8 向 UTF-16 和 UTF-32 支持的第一步。 部分更新如下
新特性 added a parser with a SAX interface (#971, #1153) support to parse from wide string types std::wstring , std::u16string , and std::u32string ; the input will be converted to UTF-8 (#1031) added support for std::string_view when using C++17 (#1028) allow to roundtrip std::map and std::unordered_map from JSON if key type is not convertible to string; in these cases, values are serialized to arrays of pairs (#1079, #1089, #1133, #1138)
Bug 修复 allow to create nullptr_t from JSON allowing to properly roundtrip null values (#1169) allow compare user-defined string types (#1130) better support for algorithms using iterators from items() (#1045, #1134) added parameter to avoid compilation error with MSVC 2015 debug builds (#1114) re-added accidentially skipped unit tests (#1176) fixed MSVC issue with std::swap (#1168)
改进 key() function for iterators returns a const reference rather than a string copy (#1098)
binary formats CBOR, MessagePack, and UBJSON now supports float as type for floating-point numbers (#1021)
详细发布说明和下载地址 https://github.com/nlohmann/json/releases/tag/v3.2.0 JSON for Modern C++ 是一个由德国大牛 nlohmann 编写的在 C++ 下使用的 JSON 库。 具有以下特点 |