Skip to content

Support inherited classes with reflection #586

Answered by stephenberry
decades42 asked this question in Q&A
Discussion options

You must be logged in to vote

Right now reflection only works on aggregate initializable structs, which rules out inheritance. This is a limitation you will see for any library currently implementing pure reflection, until we get C++26 reflection. There may be a work around this limitation, but currently I would recommend using macros or glz::meta. Thankfully the glz::meta definitions will now reflect on your member pointer names, so that saves typing.

Replies: 1 comment 6 replies

Comment options

You must be logged in to vote
6 replies
@schaumb
Comment options

@stephenberry
Comment options

@schaumb
Comment options

@scalpel4k
Comment options

@stephenberry
Comment options

Answer selected by stephenberry
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
4 participants
Converted from issue

This discussion was converted from issue #585 on December 06, 2023 12:51.