Repository navigation
Release 0.143.1
Bug fix:
- v0.143.1 fixs a bug in the jsonpath filter < comparison operator that was introduced in v0.143.0
Enhancements:
-
j.as<int>(),j.as<uint64_t>()etc. supported for binary, octal and hex string values,
in addition to decimal string values. -
Includes
json_type_traitsspecialization for integer keyed maps, with conversion
to/from string keys in abasic_json. -
The
json_type_traitsspecializations for typeTgenerated by the convenience macros now include a specialization of
is_json_type_traits_declared<T>with member constantvalueequaltrue. -
New
basic_jsonmember functionjson_type type() -
New
basic_jsonmember functionget_value_orthat gets a value as typeTif available,
or a default value if not:template <class T,class U>
T get_value_or(const string_view_type& name, U&& default_value) const;
get_value_or is the preferred alternative to
template<class T>
T get_with_default(const string_view_type& name, const T& default_value) const
Note that get_value_or requires that the first template parameter T be specified explicitly (unlike get_with_default)
Changes:
-
The basic_json
get_with_default(name)function, which returned a const reference
to the value if available and to a json null constant if not,
has been deprecated and renamed toat_or_null(name). Rationale:get_with_default(name)
is more likeat(name)(both return a const reference) than
get_with_default(name,default_value)(which returns a value.) -
The tag type
bstr_arg_thas been renamed tobyte_string_arg_t, and the constant
bstr_argtobyte_string_arg. -
The
cbor_content_handlerpublic member functionstyped_array()and private virtual functions
do_typed_array()have been moved tobasic_json_content_handler. Thedo_typed_array()
private virtual functions have been given default implementations.cbor_content_handler
has been deprecated. -
Replaced Martin Moene's span-lite with simpler implementation until
std::spanis available
(primarily for typed array interface.)