Introduction to struct_pack serialization
mainstruct_pack is a high-performance C++ serialization library designed for zero-cost abstraction. It allows for the serialization and deserialization of aggregated structures (structs where all members are public and have no custom logic) in a single line of code without requiring DSLs, macros, or manual template definitions. It uses compile-time reflection and is optimized to outperform libraries like protobuf and msgpack. For non-aggregated structs, custom reflection can be implemented using macros.
struct person {
int64_t id;
std::string name;
int age;
double salary;
};
person person1{.id = 1, .name = "hello struct pack", .age = 20, .salary = 1024.42};