getml / reflect-cpp

A C++20 library for fast serialization, deserialization and validation using reflection. Supports JSON, BSON, CBOR, flexbuffers, msgpack, TOML, XML, YAML / msgpack.org[C++20]
https://getml.github.io/reflect-cpp/
MIT License
901 stars 76 forks source link

feat: optional to/from methods on Reflector. (#150) #152

Closed m-mcgowan closed 1 month ago

m-mcgowan commented 1 month ago

Changes:

Fixes issue: #150

liuzicheng1987 commented 1 month ago

Looks good to me. I will have to wait for the code checks to run through, but just by looking at the code changes, it looks fine. Thank you so much for implementing this so quickly.

Just one minor thing: In your write_and_read.hpp, you still have this #if 0 ... #endif section, which appears to be something you meant to remove, but then forgot. Could you just quickly remove this?

m-mcgowan commented 1 month ago

Thanks for catching that. I wanted to implement write_and_read in terms of read and write, but after a few minutes I gave up :-)

Unused code removed.

liuzicheng1987 commented 1 month ago

All right, merged. Thank you for your contribution!