SaaSHub helps you find the best software and product alternatives Learn more →
Top 23 C++ Reflection Projects
-
-
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.
-
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
-
-
Nameof C++
Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
-
-
Project mention: Enum class improvements for C++17, C++20 and C++23 | news.ycombinator.com | 2024-08-04
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
-
-
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...
-
alpaca
Serialization library written in C++17 - Pack C++ structs into a compact byte-array without any macros or boilerplate code (by p-ranav)
-
-
Check out boost.pfr, it gets you there for a lot of cases. Here's a library I built with it: https://github.com/celtera/avendish
It's a proper quantum leap compared to pre-reflection
-
The question is - Can we do better? And if so, what are the trade-offs? All in all, wouldn't be great to be able to write the same code for run-time and compile-time and/or debug compile-time code at run-time?
Reflection for C++ - https://wg21.link/P2996 - introduced a new meta-programming model which is value/consteval based and can greatly improve the experience. Together with reflection is a very powerful combination but it also has its own set of trade-offs such as slower compilation-times.
This post is about `mp` - https://github.com/boost-ext/mp - meta-programming library which supports - similar to P2996 - meta-programming model for easier transition as it supports C++20 (msvc, gcc, clang), has a bit faster compilation times than P2996, but mostly, it makes meta-programming a 'normal' C++. In the mp world no difference between run-time and compile-time, whole standard library can be leveraged and it has reflection integration with C++20 using https://github.com/boost-ext/reflect. Of course it has it own set of trade-offs but, IMHO, it has a lot of potential and it's super fan.
> Example (API)
// mp::meta
-
and in most of the special-cased code in generate_canonical() you return a number in the semi-open interval [0, 1). I didn't take the time to assess the correctness of _generate_canonical_generic(), but given that it wasn't purposely generating 1.0, I wouldn't expect it to be uniformly distributed in the interval [0, 1].
* I say trying because multiplying by (b-a) and adding a introduces rounding errors.
[1]: https://github.com/DmitriBogdanov/UTL/blob/master/docs/modul...
-
-
-
-
-
-
-
-
Project mention: 🚀Announcing conjure_enum - a C++20 enum and typename reflection Library | dev.to | 2024-07-31
We're pleased to announce the release of conjure_enum, a lightweight header-only C++20 library designed to streamline working with enums and typenames by providing simple reflection capability.
-
-
SaaSHub
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
C++ Reflection discussion
C++ Reflection related posts
-
C++20 – Back to the Future Meta-Programming
-
Out of bounds memory access in V8 in Google Chrome prior to 120.0.6099.224
-
Rooting for P1061 "Structured Bindings can introduce a Pack"
-
What C++ library do you wish existed but hasn’t been created yet?
-
A basic reflection-like system for editing object fields in a C++ game engine
-
enum_name (yet another enum to/from string conversion utility >=C++11)
-
what is the best API for serialization?
-
A note from our sponsor - SaaSHub
www.saashub.com | 24 Jun 2025
Index
What are some of the best open-source Reflection projects in C++? This list will help you:
# | Project | Stars |
---|---|---|
1 | entt | 11,199 |
2 | Magic Enum C++ | 5,484 |
3 | rttr | 3,298 |
4 | Nameof C++ | 2,203 |
5 | cista | 2,036 |
6 | glaze | 1,913 |
7 | Better Enums | 1,753 |
8 | pfr | 1,401 |
9 | refl-cpp | 1,138 |
10 | alpaca | 519 |
11 | structopt | 492 |
12 | avendish | 445 |
13 | reflect | 433 |
14 | UTL | 289 |
15 | Refureku | 242 |
16 | meta.hpp | 136 |
17 | RareCpp | 124 |
18 | metapp | 122 |
19 | serdepp | 109 |
20 | easy_reflection_cpp | 102 |
21 | pfr_non_boost | 72 |
22 | conjure_enum | 58 |
23 | enum.hpp | 44 |