Skip to content

v6.0.0

Choose a tag to compare

@stephenberry stephenberry released this 10 Oct 16:38
· 39 commits to main since this release

Breaking Changes

  • Removed the experimental language interop from v5.6.0. All include/glaze/interop/* headers, the src/interop target, and associated tests have been deleted, and the glaze_BUILD_INTEROP CMake option no longer exists. #1976
  • Renamed the dynamically typed glz::json_t to glz::generic (include/glaze/json/generic.hpp). #1984
  • Streaming HTTP clients now surface server-side failures as category-aware std::error_code instances via glz::http_status_category(). Handlers that assumed generic networking errors should read the status code with glz::http_status_from.

Highlights

Reflection & Metadata

glz::meta::modify

  • New glz::meta<T>::modify, letting you rename fields, add aliases, or append computed keys without re-declaring the full object (include/glaze/core/meta.hpp). See modify reflection guide.

Self Constraints

  • Validate the aggregate after deserialization by attaching a glz::self_constraint, which runs once all members have been populated and reports friendly messages on failure (include/glaze/core/constraint.hpp).
struct cross_constrained
{
   int age{};
   std::string name{};
};

template <>
struct glz::meta<cross_constrained>
{
   using T = cross_constrained;

   static constexpr auto combined = [](const T& v) {
      return ((v.name.starts_with('A') && v.age > 10) || v.age > 5);
   };

   static constexpr auto value = object(&T::age, &T::name);
   static constexpr auto self_constraint = glz::self_constraint<combined, "Age/name combination invalid">;
};

glz::as_array wrapper

  • Use glz::as_array<&T::member> when declaring metadata to serialize/deserialize aggregate members as positional arrays while keeping struct storage.

Improvements

Fixes

Full Changelog: v5.7.2...v6.0.0