Does it have to be C++26 reflection? :) 'Cause I use Unreal Engine-style reflection in some of my personal projects, via a custom reflection tool. I use it for serialization, debugging, editor introspection, garbage collection, script binding, RPCs/network hookup, creating state machines, ORM creation, making dependency injection easier, and documentation generation.
Sounds very interesting. Care to elaborate more? Im fairly new to c++ and I'm always running into better practises, libraries, gotchas, etc everday, hah
if you’re new to c++, in my opinion, you shouldn’t even look at the reflection features yet. There are few good use cases for it. If you’re not familiar enough with the more mature language features yet, it can be easy to overuse reflection.
Though it depends on how “new” you are to c++. Also, again, just my personal opinion.
Keeping in mind that Unreal Engine is pretty non-idiomatic, you can read up on how Unreal Engine 5 does reflection. Mine is similar, though I designed mine mostly separately (have been working on this idea for over a decade).
In the MUD project, I use reflection for serialization, garbage collection, script-binding, user-help generation, and enum-to-string functionality, plus most likely other things I forgot :)
By custom tool do you mean something you made? Would be interested in more details and implementing something like it myself if it doesn’t turn out to be too much trouble!
View all comments
18
u/Kronikarz May 03 '26
Does it have to be C++26 reflection? :) 'Cause I use Unreal Engine-style reflection in some of my personal projects, via a custom reflection tool. I use it for serialization, debugging, editor introspection, garbage collection, script binding, RPCs/network hookup, creating state machines, ORM creation, making dependency injection easier, and documentation generation.