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

Remove the need for default ctors in MINHTON message types #172

Open
janagoe opened this issue Feb 12, 2024 · 0 comments
Open

Remove the need for default ctors in MINHTON message types #172

janagoe opened this issue Feb 12, 2024 · 0 comments
Labels

Comments

@janagoe
Copy link
Member

janagoe commented Feb 12, 2024

For serialization purposes, cereal requires default constructors since it handles a std::variant.
Maybe we can omit this requirement?

Cereal does support serializing types without default constructor [1]. But with using variants, cereal first creates a default constructed variant (holding the wanted type) and afterwards initializes the members [2]. Hence the way described in [1] (likely?) does not work with variants.

[1] https://github.com/USCiLab/cereal/blob/f3e31f32f70d4cffaa67dbc6d76ece125c6cf484/include/cereal/access.hpp#L117-L159
[2] https://github.com/USCiLab/cereal/blob/f3e31f32f70d4cffaa67dbc6d76ece125c6cf484/include/cereal/types/variant.hpp#L70

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

1 participant