iml130 / sola

A decentralized communication middleware
https://iml130.github.io/sola/
Other
8 stars 5 forks source link

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

Open janagoe opened 7 months ago

janagoe commented 7 months ago

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