News for hackers. Stuff that matters.
Re:Reflection for C++26 by germandiago on Monday July 01, 2024 @11:20PM (#40853258)
I suggest you to take a look at Boost.Describe.

I have a scripting layer in a game that needs to set properties in a C++ Model. I used a single Boost.Describe macro per struct and a generic get/set property. It worked very well and made me get rid of a lot of boilerplate.

https://www.boost.org/doc/libs/develop/libs/describe/doc/htm...

Re:Reflection for C++26 by beached_whale on Tuesday July 02, 2024 @01:26AM (#40853792)
Boost.PFR is really neat and doesn’t need manual mapping for aggregate types
Re:Reflection for C++26 by germandiago on Tuesday July 02, 2024 @06:39AM (#40855268)
What I needed is accessing thosr by name. So PFR won't do.
Re:Reflection for C++26 by beached_whale on Tuesday July 02, 2024 @08:15PM (#40861684)
Should be able to build that on if it isnt there. But at runtime the type would need to be a sum type like variant.
Re:Reflection for C++26 by throwway120385 on Tuesday July 02, 2024 @11:31AM (#40857633)
Yeah, that looks like it would do what I need.