github stephenberry/glaze v5.6.0

latest releases: v8.3.0, v8.2.0, v8.1.0...
12 months ago

New Features

C shared library interop (FFI) using Glaze and modern C++ reflection in #1890

Documentation: https://stephenberry.github.io/glaze/interop/

Key transformers in #1889

struct my_struct {
   int user_id = 123;
   std::string first_name = "John";
};

// Apply camelCase transformation
template <>
struct glz::meta<my_struct> : glz::camel_case {};

// JSON output: {"userId":123,"firstName":"John"}

8 Naming Convention Transformers:
camel_case: snake_case → camelCase
pascal_case: snake_case → PascalCase
snake_case: camelCase/PascalCase → snake_case
screaming_snake_case: any → SCREAMING_SNAKE_CASE
kebab_case: any → kebab-case
screaming_kebab_case: any → SCREAMING-KEBAB-CASE
lower_case: any → lowercase
upper_case: any → UPPERCASE

Zero Runtime Overhead: All transformations occur at compile-time through constexpr functions

Use smallest object when encountering ambiguous variants in #1903

Previously, when multiple variant types had overlapping fields (e.g., one type being a subset of
another), Glaze would fail with error_code::no_matching_variant_type. This was particularly
problematic for common patterns like:

  • Progressive detail levels (BasicInfo → DetailedInfo → FullInfo)
  • Optional field patterns where simpler types are subsets of complex ones
  • API versioning where newer types extend older ones

The resolution strategy:

During JSON parsing, when multiple object types in a variant match all their required fields, the type with the minimum field count is automatically selected. This ensures the most specific/appropriate type is chosen.

Improvements

Full Changelog: v5.5.5...v5.6.0

Don't miss a new glaze release

NewReleases is sending notifications on new releases.