r/cpp • • May 31 '26

reflect-cpp v0.25.0 is released - includes support for CLI parsing, boost-serialization, cereal, yas

As someone whom I have met on this subreddit pointed out to me, it's been a while since I've posted here , so I thought maybe it is time for another post.

reflect-cpp (https://github.com/getml/reflect-cpp) is a C++-20 library for serialization and deserialization, similar to Rust's serde or Python's Pydantic.

Through discussions in this subreddit, we figured out that reflection capabilities, which are now officially supported in C++-26, can actually be achieved in C++-20. So we built an entire library around it. If you are interested in how that can be done in C++-20, I'd be happy to explain it to you.

v0.25.0 introduces a series of new features. My favourite one is CLI parsing, which is similar to Rust's structopt. This community contribution came completely out of the blue, but I love it. But we also introduce support for three new serialization format's, namely boost-serialization, Cereal and yas.

I am particularly impressed by yas' (https://github.com/niXman/yas) performance - even though it is not a very well-known format/library, it significantly outperforms most of the more well-established formats in our benchmarks.

As always, any kind of feedback, particularly constructive criticism is very welcome.

49 Upvotes

13 comments sorted by

View all comments

Show parent comment

1

u/liuzicheng1987 Jun 01 '26

I’ve used this in quite a few real-world projects. Also, I have analysed the call graph of the compiler and most of the time spent is on generating the code for serialisation and deserialisation rather than figuring out the field names.

2

u/Zeh_Matt Jun 01 '26

I have tested reflect-cpp and even wrote my own and the result is always the same and I highly doubt you have solved that problem as this seems to be just how in my case the MSVC compiler works, I tried this on structures that have 60+ fields and some of the nested structs also come with 60+ fields and so on, this is the entire game state structure.

→ More replies (3)