Hacker News new | ask | show | jobs
by germandiago 722 days ago
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...

2 comments

Boost.PFR is really neat and doesn’t need manual mapping for aggregate types
What I needed is accessing thosr by name. So PFR won't do.
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.
Yeah, that looks like it would do what I need.