Release 1.4.0
-
Fixed bug:
-
Enhancements:
-
Use
std::from_charsfor chars to double conversion when supported in GCC and VC.
This reverts the removal of this feature in 0.170.0, because of issue std::from_chars parsing fails tests on Windows.
That issue has been addressed. -
New
basic_json_optionsmemberlossless_bignum. Iftrue, reads out of range floating point numbers
as strings with tagsemantic_tag::bigdec. Defaults to true. -
New reflection trait definitions,
jsoncons::reflect::json_conv_traits, that support non-throwing conversions and uses-allocator construction.
These replacejsoncons::json_type_traits, but for backwards compatibility,json_conv_traitsdefaults tojson_type_traitsif a type conversion is undefined. -
New non-throwing versions of the decode functions that return a
std::expected-like result (likestd::expected<T,jsoncons::read_error>),try_decode_jsontry_decode_csvtry_decode_bsontry_decode_cbortry_decode_msgpacktry_decode_ubjson
-
New non-throwing versions of the encode functions that return a
std::expected-like result (likestd::expected<void,jsoncons::write_error>),try_encode_jsontry_encode_csvtry_encode_bsontry_encode_cbortry_encode_msgpacktry_encode_ubjson
-
New non-throwing accessor
try_as<T>()forbasic_jsonthat return astd::expected<T,conversion_error>-like result,
-
-
Changes
-
Until now, the reflection traits generated by the convenience macros
JSONCONS_ALL_MEMBER_TRAITS
etc. produced JSON (or other formats) with object names in sorted order. After this release,
they will produce JSON, BSON etc. with object names in the order that they appear as macro arguments. -
The
allocator_sethelper functionscombine_allocatorsandtemp_allocator_onlyhave been
deprecated and will be removed in a future release. Usemake_alloc_setinstead. -
The
jsoncons::csv::result_options::valueoption has been deprecated and will be removed in a
future release. See What does result_options::value do in json_query()?
for the rationale for this change. Usejsoncons::csv::result_options{}instead. -
basic_json::dumpandencode_jsonoverloads that take ajsoncons::indentingargument have been
deprecated and will be removed in a future release. Use the_prettyoverloads (introduced in 0.155.0)
for prettified output (line indentation.)
-
-
Breaking change to staj iterator classes
- Classes
staj_array_viewandstaj_object_viewand corresponding factoriesstaj_array
andstaj_objecthave been removed. staj_array_iteratorandstaj_object_iteratorobjects are now constructed directly
from a cursor rather than through one of these view objects.- Classes
staj_array_iteratorandstaj_object_iteratornow havebeginandend
non-member functions for range-based for loop support.
We don't expect this change will affect many users. In any case the change is simple, e.g.
auto view = staj_object<std::string,json>(cursor); for (const auto& key_val : view) { // ... }becomes
auto iter = staj_object_iterator<std::string,json>(cursor); for (const auto& key_val : iter) { // ... } - Classes