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

boost::pfr #25

Open
xR3b0rn opened this issue Nov 29, 2023 · 3 comments
Open

boost::pfr #25

xR3b0rn opened this issue Nov 29, 2023 · 3 comments

Comments

@xR3b0rn
Copy link

xR3b0rn commented Nov 29, 2023

In the current beta release of boost, boost::pfr comes with a new feature for extracting the struct name from a given type. This way structopt could get rid of the library visit_struct and fully rely on boost::pfr. Or, since the new boost::pfr feature requries C++20, to still support older C++ standards , the current reflection mechanism might stay as fallback.

@p-ranav
Copy link
Owner

p-ranav commented Nov 30, 2023

From here, it looks to me like they figured out how to get the field names to appear in FUNCSIG strings for functions templated on the object, and then parse them out of that.

I will try and test it out soon, it seems there are some limitations, not sure how much (if at all) that would affect the structopt feature list.

@xR3b0rn
Copy link
Author

xR3b0rn commented Nov 30, 2023

I assumed the string is parsed from the func sig. I still wonder why it requires C++20.

@schaumb
Copy link

schaumb commented Jan 1, 2024

Hi @xR3b0rn ! Thanks for mentions my method here! This hack is usable only for C++20 because it uses the P1907R1 standard modification. Before this, the template hack cannot be used.
I can help implement this feature.

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

No branches or pull requests

3 participants