Solutions like Dependabot or Renovate update but don't merge dependencies. You need to do it manually while it could be fully automated! Add a Merge Queue to your workflow and stop caring about PR management & merging. Try Mergify for free. 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
Project mention: What C++ library do you wish existed but hasn’t been created yet? | /r/cpp | 2023-07-08I'm not sure this is quite what you're asking for, but this library has been super helpful to me in the past : https://github.com/Neargye/magic_enum
-
Nameof C++
Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
In general, nameof for reflection
-
InfluxDB
Collect and Analyze Billions of Data Points in Real Time. Manage all types of time series data in a single, purpose-built database. Run at any scale in any environment in the cloud, on-premises, or at the edge.
-
Project mention: What are some C++ projects with high quality code that I can read through? | /r/cpp_questions | 2023-01-16
I like boost::hana. Wish I had more chances to use it at work.
-
-
Project mention: State machines with C++20 coroutines and Asio/Boost Async | /r/cpp_questions | 2023-04-08
Hello all. Being a huge fan of state machine and coroutines, I have been browsing around for examples of what other people do combine these two. I have been using boost-ext/sml for quite many projects and are quite happy about that. But when transitioning to code that relies on coroutines, I would like to write entry/exit/actions/guard methods that uses coroutines and where I can co_await on awaitables from Asio and more recently "Boost Async".
-
refl-cpp
Static reflection for C++17 (compile-time enumeration, attributes, proxies, overloads, template functions, metaprogramming).
Project mention: C++ Reflection for Component Serialization and Inspection | /r/gameenginedevs | 2023-03-04I’ve been using https://github.com/veselink1/refl-cpp for my recent project where i needed reflections, especially for serialization. Cant wait for c++48 and reflections in standard
-
Proxy seems more likely than Dyno or AnyAny to be a standard way of doing this in C++'s future.
-
Mergify
Updating dependencies is time-consuming.. Solutions like Dependabot or Renovate update but don't merge dependencies. You need to do it manually while it could be fully automated! Add a Merge Queue to your workflow and stop caring about PR management & merging. Try Mergify for free.
-
Project mention: rust-like traits on plain C++ with short macro (type erasure actually) | /r/cpp | 2023-04-07
Or dyno or Poly or Not-Actually-Boost.TE or ...
-
-
jni-bind
JNI Bind is a set of advanced syntactic sugar for writing efficient correct JNI Code in C++17 (and up).
Project mention: In 2023, what is the easiest recommended way to call a Java class from C++? Note that the opposite is easy through JNI, JNA or JNR. Now C++ calling Java has been historically hard. | /r/cpp_questions | 2023-04-29 -
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
-
-
Matrix
C++ Matrix -- High performance and accurate (e.g. edge cases) matrix math library with expression template arithmetic operators (by hosseinmoein)
Yes, I have. As matter of fact I have another open source (https://github.com/hosseinmoein/Matrix) that uses this technique.
-
-
Hi! I have just finished most of my metaprogramming library called mlib. I think this is very useful as it is very small and has very powerful features, go and have a look! robertshepherdcpp/mlib: mlib is a fast, simple c++ meta-programming library that uses c++20. (github.com) .Here is an example snippet:
-
Project mention: What's the most hilarious use of operator overloading you've seen? | /r/cpp | 2023-05-06
operator"" can be used in a similar way to expression templates (DSLs), where the type of the resulting expression is dependent on the string contents. For example ctre makes use of this to build efficient regular expression parsers, and kumi uses this in conjunction with operator[] to make tuple indexing quite elegant
-
Project mention: Introducing ZXORM - A C++20 ORM for SQLite with Compile Time Type Safety | /r/cpp | 2023-03-30
-
-
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.
I made SpeciaLUT to convert bool/enum runtime tests to compile-time conditionals — by compiling all branching combinations in hot functions and saving them in a lookup-table, so the optimal one can be called at runtime. Reason: as an HPC consultant I encountered many codes that grew without good architecture, in which features would just be added and branching would propagate through all levels. This yields 10% to 50% performance increase in such codes.
-
-
-
SonarCloud
Analyze your C and C++ projects with just one click.. SonarCloud, a cloud-based static analysis tool for your CI/CD workflows, offers a one-click automatic analysis of C and C++ projects hosted on GitHub. Zero configuration and free for open-source projects! Analyze free.
C++ Metaprogramming related posts
- 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
- I implement a fast, macro-based namedtuple works under C++11
- C++ Polymorphism Without Inheritance Using Glaze
-
A note from our sponsor - Mergify
blog.mergify.com | 26 Sep 2023
Index
What are some of the best open-source Metaprogramming projects in C++? This list will help you:
Project | Stars | |
---|---|---|
1 | Magic Enum C++ | 3,918 |
2 | Nameof C++ | 1,759 |
3 | hana | 1,563 |
4 | Experimental Boost.DI | 1,038 |
5 | sml | 976 |
6 | refl-cpp | 942 |
7 | proxy | 689 |
8 | te | 368 |
9 | feelpp | 282 |
10 | jni-bind | 173 |
11 | hsm | 172 |
12 | lwlog | 167 |
13 | protopuf | 136 |
14 | constexpr-sql | 128 |
15 | Matrix | 83 |
16 | CppML | 51 |
17 | mlib | 39 |
18 | kumi | 34 |
19 | zxorm | 29 |
20 | optimizing-the-memory-layout-of-std-tuple | 27 |
21 | SpeciaLUT | 26 |
22 | crunchy-bytes | 5 |
23 | static_string | 2 |