Skip to content

Modernize PackedData classes

Gerhard Raven requested to merge modernize-packed-data-classes into master
  • autogenerate the 'decomposition' of plain aggegrate using boost::pfr
    • this reduces boiler plate code, and guarantees all fields are persisted
  • use decomposition to trigger i/o of 'current' version of packed data structs, and use in load and save
  • the above fixes the const-correctness of load which should pass non-const references to data, but as it was typically implemented by calling save which passes const references instead -- which was then 'fixed' by using a C-style cast in the downstream buffer code to (implicitly!) cast away the const again...
    • aside: implementing load by calling save was/is a bit confusing as it is not clear what decides on I vs. O -- the only difference is the Buffer type, and hence that must determine which direction the data is moving... which is a bit obfuscated IMHO
  • drop redundant inline qualifiers
  • do not 'hide' default constructors which would otherwise never be auto-generated by the compiler anyway
  • prefer std::array over boost::array

sits on top of !3165 (merged)

Edited by Gerhard Raven

Merge request reports

Loading