3 ms·
For the specific domain of serializaton/deserialization, the reflect-cpp [1] library (C++20) can serialize/deserialize arbitrary structs to/from several formats
by cherryteastain 2y ago
For the specific domain of serializaton/deserialization, the reflect-cpp [1] library (C++20) can serialize/deserialize arbitrary structs to/from several formats including json and yaml without any sort of tagging or traits
[1] https://github.com/getml/reflect-cpp https://github.com/getml/reflect-cpp
- adzm 2y agoI'm still trying to figure out how it manages to get the member names at compile time! Turns out it uses source_location and parses the string all at compile time! https://www.reddit.com/r/cpp/comments/18b8iv9/c20_to_tuple_with_compiletime_names/ https://www.reddit.com/r/cpp/comments/18b8iv9/c20_to_tuple_w...
- gpderetta 2y agoIn the grand tradition of C++, the compiler already knows everything the programmer wants, it just has to be coerced with increasingly convoluted incantations to give it away.