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

What about "boost pfr" extension? #231

Open
denzor200 opened this issue Mar 27, 2021 · 8 comments
Open

What about "boost pfr" extension? #231

denzor200 opened this issue Mar 27, 2021 · 8 comments

Comments

@denzor200
Copy link
Contributor

denzor200 commented Mar 27, 2021

It's a new reflection library from Antony Polukhin
https://github.com/boostorg/pfr
Why not adapt it to fusion as another extension?
And then we get rid of from BOOST_FUSION_ADAPT_STRUCT.

@denzor200
Copy link
Contributor Author

Draft here:
#232

This was referenced Jan 16, 2022
@denzor200
Copy link
Contributor Author

denzor200 commented Nov 27, 2022

I need to apply a small patch here: https://github.com/boostorg/fusion/blob/boost-1.80.0/include/boost/fusion/support/tag_of.hpp#L55|
Just like this sample:
https://godbolt.org/z/4ePcWbYqh
It will allow me to integrate PFR as fallback, so thus PFR will be selected when no other reflection not found for T.
This strategy is so simple to implement and will be conviniece for Fusion's users.

@denzor200
Copy link
Contributor Author

@djowel what do you think about this patch above?

@djowel
Copy link
Collaborator

djowel commented Nov 29, 2022

What is non_fusion_tag ? [edit, sorry if that was not clear]... I meant why is the link pointing to the non_fusion_tag ?

@denzor200
Copy link
Contributor Author

What is non_fusion_tag ? [edit, sorry if that was not clear]... I meant why is the link pointing to the non_fusion_tag ?

The link pointing to the line that I want to edit. Like this:

-              mpl::identity<non_fusion_tag> >::type
+              mpl::identity<typename tag_of_fallback<Sequence>::type> >::type

And also this before the line(in the detail namespace):

template<typename Sequence, typename Active=void>
struct tag_of_fallback
{
    typedef non_fusion_tag type;
};

@djowel
Copy link
Collaborator

djowel commented Nov 29, 2022

Ah. Makes sense. Go for it.

@denzor200
Copy link
Contributor Author

Ah. Makes sense. Go for it.

#262
Can you merge this before I do it?

@denzor200
Copy link
Contributor Author

Ah. Makes sense. Go for it.

Here: #263

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

2 participants