Skip to content

Patternia Documentation

A modern C++ pattern matching DSL

Patternia is a modern C++ pattern-matching DSL designed to make dispatch logic clear, expressive, and type-safe - without sacrificing performance or compilation efficiency.

Literal matching is split intentionally: - lit(value) and lit_ci(value) are the runtime forms for general values and strings. - lit<value>() is the compile-time form for static integral/enum literals that can feed the lowering engine.


Start Here

Concepts and Tutorials

Worked Examples

Reference

Project Information


System Requirements

  • C++ Standard: C++17 or later
  • Compilers: GCC >= 11, Clang >= 12, MSVC >= 2019
  • Platforms: Linux, Windows, macOS

Benchmarking

  • Run benchmark suite from project root:
.\build\bench\ptn_bench.exe --benchmark_filter="Variant" --benchmark_out=build/variant_all.json --benchmark_out_format=json
  • Visualize one JSON across implementations:
py -3 scripts/bench_single_report.py --input build/variant_all.json --include "Variant" --outdir build/bench/single --prefix variant_single

Make logical structure explicit, make C++ code more elegant