C++ Reflection

Open-source C++ projects categorized as Reflection

Top 23 C++ Reflection Projects

  • entt

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

    Project mention: Using Jolt with flecs & Dear ImGui: Game Physics Introspection | dev.to | 2024-04-17

    EnTT is a popular alternative to flecs for C++, which has different performance/memory characteristics.

  • CodeRabbit

    CodeRabbit: AI Code Reviews for Developers. Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.

    CodeRabbit logo
  • 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

  • rttr

    C++ Reflection Library

  • Nameof C++

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

  • cista

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

  • Better Enums

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

  • pfr

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

  • SaaSHub

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

    SaaSHub logo
  • glaze

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

    Project mention: Enum class improvements for C++17, C++20 and C++23 | news.ycombinator.com | 2024-08-04
  • refl-cpp

    Static reflection for C++17 (compile-time enumeration, attributes, proxies, overloads, template functions, metaprogramming).

    Project mention: Out of bounds memory access in V8 in Google Chrome prior to 120.0.6099.224 | news.ycombinator.com | 2024-01-25

    You'd be surprised how much friction you'd have for C++ reflection. First, since it's a custom build step, you can do a mix of custom code gen and C++ constexpr/consteval for static reflection. Here's a header-only implementation for adding compile time reflection purely within the language [1]. And v8 already does dynamic code gen as part of its build process (to generate the snapshot to speedup instantiation of the isolate). Dynamic reflection is a must since JS is a dynamic language with reflection support.

    Now of course, I don't know the specific details of reflection needed for the abstractions you reference and clearly V8 is still doing some amount of manual IR generation, so it's possible it would be a substantial investment to actually retrofit those techniques into v8. One would have to do a careful analysis of historical security exploits & specific techniques and their ability to prevent to figure out if it's worth adding those abstractions (especially since there is a potential performance tradeoff as you mention). As I said, I think there's insufficient research in this area to establish a compelling body of best practices (not to take away from the contributions of the GraalJS team to this space).

    [1] https://github.com/veselink1/refl-cpp

  • alpaca

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

  • structopt

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

  • 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

  • Refureku

    Cross-platform C++17 Runtime Reflection Library

  • meta.hpp

    C++20 Dynamic Reflection Library

  • RareCpp

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

  • metapp

    C++ runtime reflection library

  • serdepp

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

  • easy_reflection_cpp

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

  • pfr_non_boost

    Boost.PFR without the boost namespaces

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

  • enum.hpp

    C++17 compile-time enum reflection library

  • enum_name

    Converting (scoped)enum values to string names written in C++>=11.

  • reflect

    A single file header only static reflection library for C++20. (by M-Fatah)

  • 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

  • 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
  • Behind the magic of magic_enum

    4 projects | /r/cpp | 12 Feb 2023
  • A note from our sponsor - CodeRabbit
    coderabbit.ai | 7 Nov 2024
    Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR. Learn more →

Index

What are some of the best open-source Reflection projects in C++? This list will help you:

Project Stars
1 entt 10,191
2 Magic Enum C++ 4,909
3 rttr 3,168
4 Nameof C++ 2,084
5 cista 1,818
6 Better Enums 1,669
7 pfr 1,331
8 glaze 1,186
9 refl-cpp 1,078
10 alpaca 475
11 structopt 459
12 avendish 420
13 Refureku 225
14 meta.hpp 134
15 RareCpp 124
16 metapp 112
17 serdepp 106
18 easy_reflection_cpp 94
19 pfr_non_boost 64
20 conjure_enum 51
21 enum.hpp 44
22 enum_name 20
23 reflect 15

Sponsored
CodeRabbit: AI Code Reviews for Developers
Revolutionize your code reviews with AI. CodeRabbit offers PR summaries, code walkthroughs, 1-click suggestions, and AST-based analysis. Boost productivity and code quality across all major languages with each PR.
coderabbit.ai

Did you konow that C++ is
the 6th most popular programming language
based on number of metions?