C++ Reflection

Open-source C++ projects categorized as Reflection

Top 23 C++ Reflection Projects

  1. entt

    Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much more

  2. 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.

    InfluxDB logo
  3. 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

  4. rttr

    C++ Reflection Library

  5. Nameof C++

    Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum

  6. cista

    Cista is a simple, high-performance, zero-copy C++ serialization & reflection library.

  7. glaze

    Extremely fast, in memory, JSON and reflection library for modern C++

    Project mention: Enum class improvements for C++17, C++20 and C++23 | news.ycombinator.com | 2024-08-04
  8. Better Enums

    C++ compile-time enum to string, iteration, in a single header file

  9. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
  10. pfr

    std::tuple like methods for user defined types without any macro or boilerplate code

  11. 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-01

    It'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...

  12. alpaca

    Serialization library written in C++17 - Pack C++ structs into a compact byte-array without any macros or boilerplate code (by p-ranav)

  13. structopt

    Parse command line arguments by defining a struct (by p-ranav)

  14. avendish

    declarative polyamorous cross-system intermedia objects

    Project mention: What's new in C++26 (part 1) | news.ycombinator.com | 2024-09-07

    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

  15. reflect

    C++20 Static Reflection library (by qlibs)

    Project mention: C++20 – Back to the Future Meta-Programming | news.ycombinator.com | 2024-07-15

    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

  16. UTL

    Collection of self-contained header-only libraries for C++17

    Project mention: Show HN: Fast Random Library for C++17 | news.ycombinator.com | 2025-06-02

    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...

  17. Refureku

    Cross-platform C++17 Runtime Reflection Library

  18. meta.hpp

    C++20 Dynamic Reflection Library

  19. RareCpp

    Creating a simpler, more intuitive means of C++ reflection

  20. metapp

    C++ runtime reflection library

  21. serdepp

    c++ serialize and deserialize adaptor library like rust serde.rs

  22. easy_reflection_cpp

    Reflection brings the best way to serialize/deserialize json and yaml in C++

  23. pfr_non_boost

    Boost.PFR without the boost namespaces

  24. conjure_enum

    Lightweight header-only C++20 enum and typename reflection

    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.

  25. enum.hpp

    C++17 compile-time enum reflection library

  26. SaaSHub

    SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives

    SaaSHub logo
NOTE: The open source projects on this list are ordered by number of github stars. The number of mentions indicates repo mentiontions in the last 12 Months or since we started tracking (Dec 2020).

C++ Reflection discussion

Log in or Post with

C++ Reflection related posts

  • C++20 – Back to the Future Meta-Programming

    2 projects | news.ycombinator.com | 15 Jul 2024
  • Out of bounds memory access in V8 in Google Chrome prior to 120.0.6099.224

    1 project | news.ycombinator.com | 25 Jan 2024
  • Rooting for P1061 "Structured Bindings can introduce a Pack"

    1 project | /r/cpp | 19 Oct 2023
  • What C++ library do you wish existed but hasn’t been created yet?

    18 projects | /r/cpp | 8 Jul 2023
  • A basic reflection-like system for editing object fields in a C++ game engine

    5 projects | /r/cpp_questions | 23 May 2023
  • enum_name (yet another enum to/from string conversion utility >=C++11)

    4 projects | /r/cpp | 19 Mar 2023
  • what is the best API for serialization?

    3 projects | /r/cpp | 13 Feb 2023
  • A note from our sponsor - SaaSHub
    www.saashub.com | 24 Jun 2025
    SaaSHub helps you find the best software and product alternatives Learn more →

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

Sponsored
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.
www.influxdata.com

Did you know that C++ is
the 7th most popular programming language
based on number of references?