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. Learn more →
Top 23 C++ Reflection Projects
Gaming meets modern C++ - a fast and reliable entity component system (ECS) and much moreProject mention: Focus: A simple and fast text editor written in Jai | news.ycombinator.com | 2023-09-02
https://pastebin.com/VPypiitk This is a very small experiment i did to learn the metaprogramming features. its an ECS library using the same model as entt (https://github.com/skypjack/entt). In 200 lines or so it does the equivalent of a few thousand lines of template heavy Cpp while compiling instantly and generating good debug code.
Line 8 declares a SparseSet type as a fairly typical template. its just a struct with arrays of type T inside. Next lines implement getters/setters for this data structure
Line 46 Base_Registry things get interesting. This is a struct that holds a bunch of SparseSet of different types, and providers getters/setters for them by type. It uses code generation to do this. The initial #insert at the start of the class injects codegen that creates structure members from the type list the struct gets on its declaration. Note also how type-lists are a native structure in the lang, no need for variadics.
Line 99 i decide to do variadic style tail templates anyway for fun. I implement a function that takes a typelist and returns the tail, and the struct is created through recursion as one would do in cpp. Getters and setters for the View struct are also implemented through recursion
Line 143 has the for expansion. This is how you overload the for loop functionality to create custom iterators.
The rest of the code is just some basic test code that runs the thing.
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
Learn any GitHub repo in 59 seconds. Onboard AI learns any GitHub repo in minutes and lets you chat with it to locate functionality, understand different parts, and generate new code. Use it for free at www.getonboard.dev.
C++ Reflection Library
Nameof operator for modern C++, simply obtain the name of a variable, type, function, macro, and enum
C++ compile-time enum to string, iteration, in a single header fileProject mention: How to convert an enum to string in C++ | news.ycombinator.com | 2023-09-30
I really like better_enums instead of magic_enums. There’s no limit on enum size with it: http://aantron.github.io/better-enums/
It was heavily used at a former employer of mine, so definitely a solid production-ready solution.
Cista is a simple, high-performance, zero-copy C++ serialization & reflection library.Project mention: what is the best API for serialization? | /r/cpp | 2023-02-13
C++ has some reflection. You can checkout cista: https://github.com/felixguendling/cista
std::tuple like methods for user defined types without any macro or boilerplate codeProject mention: Rooting for P1061 "Structured Bindings can introduce a Pack" | /r/cpp | 2023-10-19
This single feature opens a world of new possiblities. For example, it makes implementing "getting the number of fields" trivial. Furthrmore, and much more importantly, it enables turning a struct into a tuple. Currently, this can only be done by enumerating cases (therefore it's not fully generic), as with Boost PFR. By the way, PFR greatly simplifies our codebases, especially for parts with serialization and/or 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.
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
Extremely fast, in memory, JSON and interface library for modern C++Project mention: More helpful reflection in Glaze for GCC and Clang (MSVC please take note) | /r/cpp | 2023-11-29
Previously in the Glaze library, you would need to write out your key names along with the member object pointers. However, as of version 1.8.0, these key names are now optional. If the keys are not provided the member variable name will be reflected for serialization/deserialization. I'm even more excited about this reflection than the previously announced pure Clang reflection, because it works well with user customization and supports non-aggregate, non-default constructible, and non-constexpr types.
Parse command line arguments by defining a struct (by p-ranav)
declarative polyamorous cross-system intermedia objectsProject mention: Ask HN: What audio/sound-related OSS projects can I contribute to? | news.ycombinator.com | 2023-03-22
Happy to introduce you to https://ossia.io there are a lots of tasks open! You can check the projects for the general development axes: https://github.com/ossia/score/projects?query=is%3Aopen ; e.g. Audio, Musicality, Integrations, JACK & Linux integration (some are in Classic projects mode) all have audio-related tasks, some easy, some hard.
Creating new Avendish plug-ins (docs: https://celtera.github.io/avendish/) could also be fairly useful, here's a very basic example one: https://github.com/celtera/avendish/blob/main/examples/Advan...
Serialization library written in C++17 - Pack C++ structs into a compact byte-array without any macros or boilerplate code (by p-ranav)
Cross-platform C++17 Runtime Reflection Library
Creating a simpler, more intuitive means of C++ reflectionProject mention: RareCpp - Reflection Library | /r/cpp | 2023-03-24
RareCpp is a C++17 macro-based header-only reflection library for GCC, Clang, and MSVC; including simple means for accessing members by index, looping, and packing members; annotating reflected members and classes; as well as the means to make adaptive structures for beautiful implementations of builders, mappers, white-boxers, and change-listeners .
C++20 Dynamic Reflection Library
c++ serialize and deserialize adaptor library like rust serde.rs
The best way to serialize/deserialize json and yaml in C++ with reflection
C++ runtime reflection libraryProject mention: I implement a fast, macro-based namedtuple works under C++11 | /r/cpp | 2023-01-19
https://github.com/wqking/metapp Need to register your struct to a wrapper manually.
Boost.PFR without the boost namespaces
C++17 compile-time enum reflection library
Converting (scoped)enum values to string names written in C++>=11.Project mention: enum_name (yet another enum to/from string conversion utility >=C++11) | /r/cpp | 2023-03-19
A single file header only static reflection library for C++20. (by M-Fatah)Project mention: A basic reflection-like system for editing object fields in a C++ game engine | /r/cpp_questions | 2023-05-23
You can look at it here. If you want to know more about the implementation details, you can read about it here.
C++ header-only data reflection/introspection
SaaSHub - Software Alternatives and Reviews. SaaSHub helps you find the best software and product alternatives
C++ Reflection related posts
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
I implement a fast, macro-based namedtuple works under C++11
6 projects | /r/cpp | 19 Jan 2023
A note from our sponsor - InfluxDB
www.influxdata.com | 29 Nov 2023
What are some of the best open-source Reflection projects in C++? This list will help you:
|2||Magic Enum C++||4,058|