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.


Start Here

Concepts and Tutorials

Worked Examples

Reference

Project Information


System Requirements

  • C++ Standard: C++17 or later (floating-point val<V> literals need C++20)
  • Compilers (minimums enforced by cmake/CheckCompilerVersion.cmake):
Compiler Minimum
GCC 11
Clang 12
AppleClang 14
MSVC 19.30 (Visual Studio 2022)
clang-cl 18, with an MSVC 19.30+ toolset
  • Tested in CI: GCC 11/13 and Clang 14/16/18 on Linux (C++17 through C++26); MSVC and clang-cl on Windows (C++20 through C++26).

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