Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Support parameter packs for bases in BOOST_DESCRIBE_CLASS #47

Merged
merged 1 commit into from
Oct 13, 2024

Conversation

qchateau
Copy link
Contributor

No description provided.

@qchateau
Copy link
Contributor Author

It seems one of the MSVC versions is failing to compile in the CI, but that also seems unrelated to my patch ...

@pdimov
Copy link
Member

pdimov commented Mar 23, 2024

I'll take care of the MSVC failures.

However, while this is an interesting simplification, I intended to add name to the base class descriptors, and this makes it impossible. I'll need to think about this as it seems we can have one or the other, but not both.

@qchateau
Copy link
Contributor Author

The simplification is a side effect to me. As a user, having the ability to use boost describe on structs inheriting of a parameter pack is very important. I current hack my way around it, but I'd like to have native support.
It's indeed not compatible with naming bases, but would you be using the same macros to name bases ? If not, it's probably possible to support both features independantly, you'll just not be able to name parameter packs.

@pdimov
Copy link
Member

pdimov commented Mar 23, 2024

but would you be using the same macros to name bases ?

There's no separate macro for bases, it's invoked as part of BOOST_DESCRIBE_STRUCT and BOOST_DESCRIBE_CLASS. So yes, it would be the same macro. At the moment it just doesn't capture the names (the way the member descriptors do.)

Your approach has the additional benefit of supporting something like https://godbolt.org/z/xoTrP4sxT without workarounds. I'm still unclear on whether this outweighs having the names (as typeid(T).name() is less convenient and doesn't work well for all uses.)

Maybe it would be possible to support both. I'll have to think about it some more.

@qchateau
Copy link
Contributor Author

That said, the macros let you record the name of the classes that are described.
And you also record their bases (which can also be described).
So can't you already get the name of the bases via their own description?

@pdimov pdimov closed this Oct 13, 2024
@pdimov pdimov reopened this Oct 13, 2024
@pdimov pdimov merged commit ff76bbb into boostorg:develop Oct 13, 2024
110 of 116 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants