Releases: stephenberry/glaze
v5.1.2
Minor Breaking Change
Moved glz::float_precision out of the default glz::opts fields. This change does not remove any functionality from Glaze.
The glz::float_precision enum is not widely used, but had the greatest impact on the length of the template parameter name printed by compilers when compile time errors occur. By moving this out of the default glz::opts we shorten compilation errors.
This change requires a user to add their own option type:
struct float_opts : glz::opts {
glz::float_precision float_max_write_precision{};
};- In #1713
- Forgive this being in a minor release (I had forgotten I made this change)
Improvements
- noexcept traits by @stephenberry in #1721
- Use cases like
glz::customnow work with member functions labeled noexcept
- Use cases like
- Relaxed
.as<T>conversion forglz::json_t(now supports Enums) in #1712 - glz::trace better input argument order and fix for async_scope in #1720
Full Changelog: v5.1.1...v5.1.2
v5.1.1
Improvements
- glz::custom support for error_on_missing_keys and nullable fields by @stephenberry in #1710
- Using the
error_on_missing_keysoption will now allow nullable types (e.g. std::optional) to be excluded even when wrapped inglz::custom, like they work generally. Unlessskip_null_members = false, as before.
- Using the
- Support for member functions with the cli_menu in #1694
- Make value_proxy format agnostic in #1707
Fixes
- Remove duplicate version_t in #1696
- Fix GLZ_ALWAYS_INLINE for clang-cl: use attribute((always_inline)) instead of [[msvc::forceinline]] by @annihilatorq in #1702
Full Changelog: v5.1.0...v5.1.1
v5.1.0
Major Feature: Erlang External Term Format (optional support)
The Glaze CMake adds the option glaze_EETF_FORMAT, which enables reading/writing in Erlang External Term Format.
Breaking Change
Swapped the read_supported and write_supported template parameters for cleaner code. #1684
This change allows us to write:
template <read_supported<JSON> T>Rather than requiring:
template <class T>
requires read_supported<JSON, T>Associated feature test macro: glaze_v5_1_0_supported_swap
New escape_control_characters compile time option
Use the extended option escape_control_characters to escape control characters when serializing JSON strings (#1693)
Fixes
- Fixed raw_json compile error when using it in template func by @acking-you in #1671
- Fixed MSVC warnings by @stephenberry in #1680
- parse/serialize support for glz::async_vector in #1683
- Support for parse/serialize of glz::guard in #1686
Full Changelog: v5.0.2...v5.1.0
v5.0.2
Fixes
- Fixed const char* assignment for glz::json_t in #1667
- Fixed static_string size/capacity by @SlaaneshChosen in #1669
- Fixed pair handling of named enum keys in #1670
Improvements
- Added glz::array_apply, particularly useful for inserting immutable elements in #1664
- Create version.hpp by @stephenberry in #1662
- Example and documentation for handling private fields in #1659
Full Changelog: v5.0.1...v5.0.2
v5.0.1
Improvements
- glz::manage is now format agnostic and works with other formats besides JSON by @stephenberry in #1646
- Removed
glz::expectedand always usestd::expectedin #1314- This is possible because Glaze requires C++23
- Removed deprecated CMake FetchContent_GetProperties in #1650
Fixes
- Add GLZ_THROW_OR_ABORT to required headers in #1649
- Fix circular includes in #1656
- Fixed glz::seek for glz::custom fields in #1657
In Development
- Added a
glz::guardclass that wraps astd::atomic, but allows copying, moving, and assignment in #1651 - Added
glz::async_vectorin #1652 - Added string API to async_string proxies in #1654
Full Changelog: v5.0.0...v5.0.1
v5.0.0
Version 5.0.0
Customizable Compile-Time Options
The glz::opts struct is now only the default options, and more specialized options can be added to user created option structs. See Options for new compile time option customization. In this transition we've moved lesser used options out of the default glz::opts. This reduces the length of compiler errors when using Glaze and makes handling more options in the future much more manageable.
The options moved out of the default glz::opts are the following:
// Add these fields to a custom options struct if you want to use them
bool validate_skipped = false;
// If full validation should be performed on skipped values
bool validate_trailing_whitespace = false;
// If, after parsing a value, we want to validate the trailing whitespace
bool concatenate = true;
// Concatenates ranges of std::pair into single objects when writing
bool allow_conversions = true;
// Whether conversions between convertible types are allowed in BEVE, e.g. double -> float
bool write_type_info = true;
// Write type info for meta objects in variants
bool shrink_to_fit = false;
// Shrinks dynamic containers to new size to save memory
bool hide_non_invocable = true;
// Hides non-invocable members from the cli_menu (may be applied elsewhere in the future)Note
None of these options have been removed or deprecated. To use these options you simply need to create your own options struct with the additional options you wish to use. Simply inherit from glz::opts and add the fields you would like.
- Make opts use generic by @stephenberry in #1628
Removed detail namespace for to/from specializations
When writing custom serialization/parsing logic in Glaze, the to/from structs to specialize on have been removed from the detail namespace and are simply in glz.
Many other concepts and helper functions in Glaze have also been moved out of the detail namespace for cleaner custom serialization and parsing.
- Removed detail from specializations like to/from in #1625
Changed glz::detail::read to glz::parse and glz::detail::write to glz::serialize
The helper type deduction functors named glz::detail::read and glz::detail::write were confusing, because these were different than the functions glz::read and glz::write. These helper functors have been moved out of the detail namespace and renamed to parse and serialize for easier to read custom serialization and parsing.
Generic Supported Concepts
The format specific concepts like: read_json_supported and write_beve_supported added extra boilerplate and did not allow custom formats. This change removes these non-generic functions and simply uses:
template <uint32_t Format, class T>
concept write_supported = requires { detail::to<Format, std::remove_cvref_t<T>>{}; };
template <uint32_t Format, class T>
concept read_supported = requires { detail::from<Format, std::remove_cvref_t<T>>{}; };This more generic solution simplifies the code and makes adding new formats cleaner and possible for users without needing to modify the main Glaze repository.
- Generic supported concepts in #1622
Minor fixes
In development
- For
glz::asio_server, if port is 0, allow access to assigned port in #1621
Full Changelog: v4.4.3...v5.0.0
v4.4.3
Removed lots of internal macros for the use of Glaze as a C++20 module (in development).
In Development
- Removed macros in #1614
- Remove forced reflection for top level structs in repe::registry by @stephenberry in #1623
Full Changelog: v4.4.2...v4.4.3
v4.4.2
Fixes
- Fix trailing comma for tagged variants with null members in #1609
- Fix for empty objects with tagged variants in #1610
Improvements
- Added support for custom static strings by @SlaaneshChosen in #1605
- Use
glaze_static_string = truein yourglz::metafor your static string type.
- Use
In Development
- Initial TOML write support by @stephenberry in #1603
Full Changelog: v4.4.1...v4.4.2
v4.4.1
Fixes
- Fix mismatch create function for shared library API (missing noexcept) in #1596
- Fix ODR violations by @arturbac in #1604
Improvements
- Safer boolean write to avoid issues with UB booleans (non-initialized booleans) in #1597
- Add error_handler to asio_server by @stephenberry in #1602
Full Changelog: v4.4.0...v4.4.1
v4.4.0
Improvements
Fixes
- Fix wrong begin/end indices in get_name by @PaideiaDilemma in #1569
- reflect: fix uint16 compile error in find_unique_sized_index by @timsjostrand in #1575
- ASAN non null_terminated fix in #1583
- New CMake option
glaze_DISABLE_SIMD_WHEN_SUPPORTEDto disable SIMD like AVX2 when cross-compiling by @arturbac in #1590- Glaze no longer adds compiler intrinsic flags to its CMake interface definition, and instead relies on the developer's compiler flags
Test Improvements
- Testing with -Wall and -Werror for GCC (13+) by @stephenberry in #1563
- Fixed a number of warnings
Full Changelog: v4.3.1...v4.4.0