Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes! Learn more →
Top 23 C++ Metaprogramming Projects
-
Magic Enum C++
Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code
-
JetBrains
Tell us how you use coding tools. You may win a prize! Are you a developer or a data analyst? Share your thoughts about your coding tools in our short survey and get a chance to win prizes!
-
Nameof C++
Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
-
-
Project mention: Show HN: CXXStateTree – A modern C++ library for hierarchical state machines | news.ycombinator.com | 2025-07-06
Looks like SML is using user-defined literals [0, 1] to effectively pre-process the string literal into state/event objects. Looks like the string itself is turned into a template parameter in the process and I believe those shouldn't show up in the compiled code (maybe unless there's some mangling-related thing going on?)
[0]: https://en.cppreference.com/w/cpp/language/user_literal.html
[1]: https://github.com/boost-ext/sml/blob/f232328b49adf708737bef...
-
-
refl-cpp
Static reflection for C++17 (compile-time enumeration, attributes, proxies, overloads, template functions, metaprogramming).
Project mention: Abusing C to Implement JSON Parsing with Struct Methods | news.ycombinator.com | 2025-03-01It's definitively different than Frunk, the library is not a general-purpose functional toolkit. One could certainly implement it with Zig's compile-time reflection with ease (don't know much about D). Actually, it's superficially similar to refl-cpp's serialization example [1], but with far less templating magic underneath due to the restricted scope.
[1] https://github.com/veselink1/refl-cpp/blob/master/examples/e...
-
-
Sevalla
Deploy and host your apps and databases, now with $50 credit! Sevalla is the PaaS you have been looking for! Advanced deployment pipelines, usage-based pricing, preview apps, templates, human support by developers, and much more!
-
-
Project mention: C++ logging library – something I've been working on | news.ycombinator.com | 2025-01-01
-
jni-bind
JNI Bind is a set of advanced syntactic sugar for writing efficient correct JNI Code in C++20 and up (or C++17 with clang).
-
xl
A minimalist, general-purpose programming language based on meta-programming and parse tree rewrites
-
hsm
Finite state machine library based on the boost hana meta programming library. It follows the principles of the boost msm and boost sml libraries, but tries to reduce own complex meta programming code to a minimum. (by erikzenker)
-
protopuf
Protocol Puffers: A little, highly templated, and protobuf-compatible serialization/deserialization header-only library written in C++20
-
-
Tiger
C++ Matrix -- High performance and accurate (e.g. edge cases) matrix math library with expression template arithmetic operators (by hosseinmoein)
-
-
-
-
-
-
-
SpeciaLUT
Runtime choosing of template specializations using compile-time lookup-tables. Compile all states of a template function, but execute the optimal one at runtime.
-
-
InfluxDB
InfluxDB – Built for High-Performance Time Series Workloads. InfluxDB 3 OSS is now GA. Transform, enrich, and act on time series data directly in the database. Automate critical tasks and eliminate the need to move data externally. Download now.
C++ Metaprogramming discussion
C++ Metaprogramming related posts
-
Abusing C to Implement JSON Parsing with Struct Methods
-
Out of bounds memory access in V8 in Google Chrome prior to 120.0.6099.224
-
How does Swift implement primitive types in its standard library?
-
What's the most hilarious use of operator overloading you've seen?
-
State machines with C++20 coroutines and Asio/Boost Async
-
When Debug Symbols Get Large
-
C++ Reflection for Component Serialization and Inspection
-
A note from our sponsor - JetBrains
surveys.jetbrains.com | 1 Sep 2025
Index
What are some of the best open-source Metaprogramming projects in C++? This list will help you:
# | Project | Stars |
---|---|---|
1 | Magic Enum C++ | 5,645 |
2 | Nameof C++ | 2,229 |
3 | hana | 1,792 |
4 | sml | 1,272 |
5 | Experimental Boost.DI | 1,231 |
6 | refl-cpp | 1,167 |
7 | te | 488 |
8 | feelpp | 324 |
9 | lwlog | 306 |
10 | jni-bind | 297 |
11 | xl | 282 |
12 | hsm | 197 |
13 | protopuf | 186 |
14 | constexpr-sql | 141 |
15 | Tiger | 121 |
16 | conjure_enum | 77 |
17 | CppML | 60 |
18 | kumi | 54 |
19 | mlib | 46 |
20 | zxorm | 42 |
21 | optimizing-the-memory-layout-of-std-tuple | 33 |
22 | SpeciaLUT | 26 |
23 | static_string | 9 |