Patternia v0.9.1 Release Note¶
Release Date: March 18, 2026 Version: 0.9.1
Overview¶
Patternia v0.9.1 is an API refinement and packaging stabilization release.
Compared with v0.9.0, this version finishes the roadmap transition from function-style static patterns to variable-template entry points, promotes the new structural and literal forms across the public docs, and tightens the vcpkg packaging flow for clean installs.
New Features¶
val<V> Replaces lit<V>()¶
Compile-time literal matching now uses val<V>:
match(x) | PTN_ON(
val<1> >> 1,
val<2> >> 2,
_ >> 0
);
This aligns static literal patterns with the existing variable-template style
used by is<T> and alt<I>.
Runtime literal patterns are unchanged:
match(x) | on(
lit(1) >> "one",
_ >> "other"
);
C++20 Floating-Point Static Literals¶
When you compile Patternia in C++20 or later mode, val<V> now accepts
floating-point non-type template parameters:
match(x) | on(
val<3.25> >> "three-point-two-five",
_ >> "other"
);
In C++17 builds, floating-point static literals remain unavailable by design.
Use lit(3.25) there.
has<...> Is Now the Canonical Structural Entry¶
Structural matching continues the same DSL direction as val<V>:
match(p) | on(
$(has<&Point::x, &Point::y>) >> [](int x, int y) {
return x + y;
},
_ >> 0
);
The old has<...>() factory-style spelling is no longer part of the public
surface.
vcpkg Packaging Follow-Up¶
This release keeps the vcpkg port aligned with the upstream install layout and documents vcpkg as the primary installation path. It also includes the cleanup needed for a clean package install after the initial v0.9.0 port landing.
Migration Notes¶
lit<V>() -> val<V>¶
// Before
match(x) | on(
lit<1>() >> 1,
lit<2>() >> 2,
_ >> 0
);
// After
match(x) | on(
val<1> >> 1,
val<2> >> 2,
_ >> 0
);
has<...>() -> has<...>¶
// Before
$(has<&Point::x, &Point::y>()) >> [](int x, int y) {
return x + y;
}
// After
$(has<&Point::x, &Point::y>) >> [](int x, int y) {
return x + y;
}
C++17 vs C++20 Static Floating-Point Matching¶
// C++17
match(x) | on(
lit(3.25) >> "three-point-two-five",
_ >> "other"
);
// C++20+
match(x) | on(
val<3.25> >> "three-point-two-five",
_ >> "other"
);
Internal¶
include/ptn/pattern/lit.hpp: replaced the compile-time literal factory function with theval<V>variable template.include/ptn/patternia.hpp: re-exportedvalthrough the umbrella header.tests/compile_fail/: added regression coverage for removedlit<V>()andhas<...>()forms, plus pre-C++20 floating-point static literals.packaging/vcpkg/: version metadata updated for the 0.9.1 release cycle.