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
Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate codeProject mention: What C++ library do you wish existed but hasn’t been created yet? | /r/cpp | 2023-07-08
I'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 operator for modern C++, simply obtain the name of a variable, type, function, macro, and enumProject mention: Added reflection to C++ just to make my game work. | /r/gamedev | 2022-10-27
In general, nameof for reflection
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.
Your standard library for metaprogrammingProject 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.
DI: C++14 Dependency Injection Library
SML: C++14 State Machine LibraryProject 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".
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-04
I’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: Easy Polymorphism in C++ (by microsoft)Project mention: Static Interfaces, concepts vs de-virtualisation? | /r/cpp | 2023-03-24
Proxy seems more likely than Dyno or AnyAny to be a standard way of doing this in C++'s future.
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.
TE: C++17 Run-time polymorphism (type erasure) libraryProject 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 ...
:gem: Feel++: Finite Element Embedded Language and Library in C++Project mention: rodin alternatives - mfem and FreeFem-sources | libhunt.com/r/rodin | 2023-03-08
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
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)
Very fast synchronous C++17 logging library
Protocol Puffers: A little, highly templated, and protobuf-compatible serialization/deserialization header-only library written in C++20
Header only library that parses and plans SQL queries at compile time
C++ Matrix -- High performance and accurate (e.g. edge cases) matrix math library with expression template arithmetic operators (by hosseinmoein)Project mention: Update on C++ Algo Trading/ Data Analysis tool | /r/algotrading | 2023-02-05
Yes, I have. As matter of fact I have another open source (https://github.com/hosseinmoein/Matrix) that uses this technique.
A concise and readable metaprogramming language for C++
mlib is a fast, simple c++ meta-programming library that uses c++20. (by robertshepherdcpp)Project mention: New metaprogramming library called mlib | /r/cpp | 2023-02-20
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:
C++20 Compact Tuple ToolsProject 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
Zach's ORM - A C++20 ORM for SQLiteProject mention: Introducing ZXORM - A C++20 ORM for SQLite with Compile Time Type Safety | /r/cpp | 2023-03-30
Optimizing the memory layout of std::tuple
Runtime choosing of template specializations using compile-time lookup-tables. Compile all states of a template function, but execute the optimal one at runtime.Project mention: C++ Show and Tell - December 2022 | /r/cpp | 2022-12-02
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.
C++ 17 Schema Serialization Library
Experimental compile-time string manipulation C++17 library
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?
2 projects | /r/ProgrammingLanguages | 22 Jun 2023
What's the most hilarious use of operator overloading you've seen?
7 projects | /r/cpp | 6 May 2023
State machines with C++20 coroutines and Asio/Boost Async
2 projects | /r/cpp_questions | 8 Apr 2023
When Debug Symbols Get Large
2 projects | news.ycombinator.com | 9 Mar 2023
C++ Reflection for Component Serialization and Inspection
3 projects | /r/gameenginedevs | 4 Mar 2023
I implement a fast, macro-based namedtuple works under C++11
6 projects | /r/cpp | 19 Jan 2023
C++ Polymorphism Without Inheritance Using Glaze
8 projects | /r/cpp | 12 Jan 2023
A note from our sponsor - Mergify
blog.mergify.com | 26 Sep 2023
What are some of the best open-source Metaprogramming projects in C++? This list will help you:
|1||Magic Enum C++||3,918|