-
Notifications
You must be signed in to change notification settings - Fork 217
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
Provide a substitute to BOOST_FUSION_ADAPT_STRUCT_xxx macros #181
Comments
The initial idea was that user-defined types were models of the Do you see another reason to allow seeing a user defined type as an heterogeneous sequence directly, rather than using the intermediate |
@gnzlbg ping |
I think that is a pretty important advantage that might turn out to be very useful for serialization (and thus worth the trouble, but see below).
That wouldn't really be acceptable but it seems that it would only be temporary and that there is a plan to fix it.
IIUC one will be able to create an intermediate model of Struct with value/&/const&/&& semantics from an UDT. Heterogeneous algorithms would work on the intermediate model of Struct, and allow &/const&/&& access to the struct. Is that what you have in mind? If so, I don't see any reason to allow seeing an user defined type as an heterogeneous sequence (one can just write non-member non-friends functions that "adapt" the UDT as a model of Struct by returning an intermediate type). I've tried to stretch my imagination but even in the hypothetical case that types might ever be able to use heterogeneous algorithms "on themselves", then they will probably also be able to adapt themselves as a model of Struct and work on that. So I am not really able to find an use case where allowing an user defined type to be an heterogeneous would be required. |
Would it be possible to provide a substitute for
BOOST_FUSION_ADAPT_STRUCT_xxx
macros to be able to use classes and structs as heterogeneous (+associative?) sequences?I don't know if there are any C++>=11 features that would allow improving these macros or designing a new/better version of them, but that might be worth looking into.
The text was updated successfully, but these errors were encountered: