Skip to content

Conversation

@renovate
Copy link
Contributor

@renovate renovate bot commented Jan 26, 2026

This PR contains the following updates:

Package Update Change
stephenberry/glaze patch 7.0.17.0.2

Release Notes

stephenberry/glaze (stephenberry/glaze)

v7.0.2

Compare Source

Glaze v7.0.2

Highlights

  • YAML 1.2 support
  • std::expected support extended to BEVE and CBOR formats, plus std::expected<void, E> handling in JSON
  • Enum hashing improvements for writing with graceful fallbacks when perfect hashing fails and a two-element fast path
  • HTTP server/client flexibility via asio::any_io_executor for shared event loops
  • Further binary size reduction in the simple float module (~76% smaller lookup tables)

YAML Support (#​2243)

Glaze now includes a YAML 1.2 Core Schema reader and writer. All types with existing glz::meta specializations work automatically with YAML -- no additional boilerplate required.

#include <glaze/yaml.hpp>

struct my_struct {
   std::string name;
   int age;
   std::vector<std::string> tags;
};

my_struct obj{"Alice", 30, {"developer", "musician"}};

// Write YAML
std::string yaml;
glz::write_yaml(obj, yaml);
// name: Alice
// age: 30
// tags:
//   - developer
//   - musician

// Read YAML
my_struct parsed{};
glz::read_yaml(parsed, yaml);

Features:

  • Block style and flow style collections
  • Double-quoted, single-quoted, and plain scalars
  • Literal (|) and folded (>) block scalars with chomping modifiers
  • Hex (0x), octal (0o), and binary (0b) integer literals
  • Special values: .inf, -.inf, .nan, null, ~
  • YAML Core Schema tags (!!str, !!int, !!float, !!bool, !!null, !!seq, !!map)
  • Document markers (--- and ...)
  • std::variant, std::optional, std::unique_ptr, std::shared_ptr, enum, tuple, and pair support
  • File I/O helpers: glz::read_file_yaml / glz::write_file_yaml
  • Configurable options: indent_width, flow_style, skip_null_members, error_on_unknown_keys

YAML is not included in the main glaze/glaze.hpp header to avoid unnecessary compile-time cost. Include glaze/yaml.hpp explicitly.

See the YAML documentation for full details.


std::expected Support

std::expected<void, E> in JSON (#​2251)

std::expected<void, E> is now handled correctly in JSON serialization and deserialization:

std::expected<void, int> val{}; // success
std::string json;
glz::write_json(val, json);
// json: "{}"

std::expected<void, int> err = std::unexpected(42);
glz::write_json(err, json);
// json: {"unexpected":42}
BEVE and CBOR Support (#​2253)

std::expected<T, E> (including std::expected<void, E>) is now fully supported in both BEVE and CBOR formats, using the same {"unexpected": error} encoding convention as JSON.


Enum Hashing Improvements

Fallback When Hashing Fails (#​2263)

Previously, enums with adversarial value distributions could cause a compile error if the perfect hash seed search failed. The library now gracefully falls back:

  • N <= 16 values: linear search
  • N > 16 values: binary search through a compile-time sorted array

This also fixes a potential out-of-bounds read when parsing standalone enum strings at the end of input.


HTTP Server/Client Executor Support (#​2258)

glz::http_server and glz::http_client can now be constructed with an asio::any_io_executor, allowing integration into an existing ASIO application with a shared event loop.

// Use an existing executor
asio::io_context my_context;
glz::http_server server{my_context.get_executor()};

// Or let glaze create its own (default, backward-compatible)
glz::http_server server{};

The legacy constructor accepting std::shared_ptr<asio::io_context> is preserved for backward compatibility.


Binary Size Optimization

Simple Float Table Reduction (#​2248)

The simple_float module's power-of-5 lookup tables were reduced by ~76%:

  • Table range narrowed from [-64, +64] to [-16, +16] (covers typical JSON numbers)
  • Table storage split into separate arrays for better alignment
  • Exponent type downsized from int32_t to int16_t
  • Total table size reduced from ~2.5KB to ~594 bytes

Numbers with exponents outside [-16, +16] fall back to binary exponentiation.


Pull Requests

  • #​2264 - Two element ID optimization
  • #​2263 - Enum search fallback when hashing fails
  • #​2258 - HTTP server/client asio::any_io_executor support
  • #​2254 - JSON schema documentation fix
  • #​2253 - BEVE and CBOR std::expected support
  • #​2251 - std::expected<void, E> JSON support
  • #​2248 - Simple float table reduction
  • #​2243 - YAML support

Full Changelog: stephenberry/glaze@v7.0.1...v7.0.2


Configuration

📅 Schedule: Branch creation - Every minute ( * * * * * ) in timezone America/Los_Angeles, Automerge - At any time (no schedule defined).

🚦 Automerge: Enabled.

Rebasing: Whenever PR is behind base branch, or you tick the rebase/retry checkbox.

🔕 Ignore: Close this PR and you won't be reminded about this update again.


  • If you want to rebase/retry this PR, check this box

This PR was generated by Mend Renovate. View the repository job log.

@renovate renovate bot enabled auto-merge (squash) January 26, 2026 17:31
@renovate renovate bot merged commit bc4c78b into main Jan 26, 2026
4 checks passed
@renovate renovate bot deleted the renovate/stephenberry-glaze-7.x branch January 26, 2026 17:34
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

0 participants