Simple, Extensible Pattern Matching in C++14
summary
Implements a header-only pattern matching library for C++14 that compiles on GCC 5, Clang 3.6 and Visual C++ 2015 and uses integer_sequence, generic lambdas, and return type deduction to keep code minimal. It matches scalars, tuples, pointers, unique/shared/raw pointers, boost::optional/variant/any and user types via a simple tuple adapter, supports recursive variants and exhaustive-match checks, and focuses on clarity over micro-optimizations; examples include a fizzbuzz and an expression evaluator that compile and run. no macros, easy customization
AI-written summary · about
chapters (14)
- 0:00Start
- 1:18Goals
- 1:40What Is Pattern Matching
- 2:12How Well Does C + + 14 Support Pattern Matching
- 4:32Pattern Library
- 8:25Building Blocks
- 18:40Placeholders
- 20:10Compound Types
- 20:43Fizzbuzz
- 26:49Pointers
- 34:19Integrating with the Boost Libraries
- 36:47Boost Variant
- 38:02Boost Variant Example
- 40:30Exhaustive Pattern
related talks
01h 00m“MPark.Patterns: Pattern Matching in C++”
01h 00m“Using Compile-time Code Generation to build an LLVM IR Pattern Matcher”
58mThe Pattern Matching We Already Have
01h 47mFunctional C++
01h 34mMetaprogramming in C++14
57mIntroduction to C++ Template Metaprogramming
55mC++14 Reflections Without Macros, Markup nor External Tooling..
55mCustom Overload Sets and Inline SFINAE for Truly Generic Interfaces
