Skip to content

v0.7.0

Choose a tag to compare

@sentomk sentomk released this 04 Feb 17:26
· 239 commits to main since this release

Patternia v0.7.0 Release Note

Date: February 5, 2026

What's Changed

Variant Matching

Patternia now supports std::variant matching with a unified type-pattern system.

New/Updated APIs:

  • type::is<T> — type match
  • type::as<T> — type match + binding
  • type::alt<I> — index-based match (supports duplicated types)

Example:

auto r = match(v)
  .when(type::is<int>() >> "int")
  .when(type::as<std::string>() >> [](const std::string &s) { return s; })
  .when(__ >> "other")
  .end();

Guards on Binding Type Patterns

Type patterns that bind can now participate in guards:

.when(type::as<std::string>()[ _ != "" ] >> [](const std::string &s) { ... })

Diagnostics Improvements

  • Shorter, clearer static_assert messages
  • Consistent diagnostic prefixes
  • Structural has<> members validated at match-time

Documentation Updates

  • Variant matching docs expanded
  • Binding/guard semantics clarified
  • Navigation link fixes

Full release notes: v0.7.0.md