-
Notifications
You must be signed in to change notification settings - Fork 90
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
Improve reflection system and static_variant #156
Improve reflection system and static_variant #156
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Ah, you make this look so simple! Excellent work! :-)
@abitmore?
Previously, fc reflection generated visitor infrastructure capable of visiting each field of a struct; however, this is only useful for run- time operations on structures. No compile-time information was preserved about the fields of a struct, making compile-time introspection of types impossible. Now FC reflection generates rich compile-time information about the members of structs, including types, names, and structure, allowing code to be written to explore types in detail at compile-time and fetch arbitrary fields at runtime without needing to iterate over the unwanted fields. To make this a reality, a new `typelist` type was added to store this compile-time information. This type is also useful within the context of `static_variant`, as SV previously used implementation detail types in a private namespace to provide this functionality. Now `static_variant` uses the reusable functionality of `typelist` to operate, dramatically reducing the amount of code dedicated to `static_variant` and also making `static_variant` types more flexible to work with since their infrastructure is now based on the `typelist` public interface.
@pmconrad I haven't fixed the |
ea0f7bd
to
b306bd5
Compare
Thank you very much, Peter =) That means a great deal to me. |
Shiny new I'm opting to leave out a default |
b306bd5
to
a75fcb5
Compare
Please |
For real this time :)
a75fcb5
to
292584c
Compare
Done |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The fixup went into the wrong commit, but nevermind.
Previously, fc reflection generated visitor infrastructure capable of
visiting each field of a struct; however, this is only useful for run-
time operations on structures. No compile-time information was preserved
about the fields of a struct, making compile-time introspection of types
impossible.
Now FC reflection generates rich compile-time information about the
members of structs, including types, names, and structure, allowing
code to be written to explore types in detail at compile-time and fetch
arbitrary fields at runtime without needing to iterate over the unwanted
fields.
To make this a reality, a new
typelist
type was added to store thiscompile-time information. This type is also useful within the context of
static_variant
, as SV previously used implementation detail types in aprivate namespace to provide equivalent functionality. Now
static_variant
uses the reusable functionality of
typelist
to operate, dramaticallyreducing the amount of code dedicated to
static_variant
and alsomaking
static_variant
types more flexible to work with since theirinfrastructure is now based on the
typelist
public interface.These changes are necessary for bitshares/bitshares-core#1860