Documentation
The basics
How to install reflect-cpp using vcpkg, conan, cmake or direct inclusion.
What formats are supported by reflect-cpp, such as JSON, XML, msgpack, etc.
Recaps the motivating example in the README.
For defining fields that might be absent in your serialized format.
For making struct A inherit the fields of struct B.
For modifying structs before serialization and deserialization.
An alternative syntax that allows for powerful functionalities.
For representing strings that can only assume a limited number of enumerated values.
How reflect-cpp handles C++ enums.
For structs that can be one of several formats.
For defining recursive structures.
For serializing and deserializing timestamps and durations.
For skipping fields during serialization and/or deserialization.
For adding comments to your serialized format.
For error handling without exceptions.
How reflect-cpp treats containers in the standard library.
For serializing and deserializing std::expected, the C++-23 result type.
How reflect-cpp handles C arrays and inheritance.
How reflect-cpp handles binary strings for formats that support them.
For expressing numbers in different formats.
For defining default values for fields that might be absent.
For serializing and deserializing atomic types.
Validation
For requiring that strings follow user-defined regex patterns.
For imposing constraints on numbers.
For defining more complex validators using operators.
For imposing size constraints on containers.
For validating your schema before you send it to your C++ backend.
Generic elements
A map-like type representing an object with unknown field names.
A catch-all type that can represent almost anything.
For adding extra fields with unknown names.
Custom classes
Useful helper functions and classes
For replacing one or several fields in a struct.
For casting structs as other structs.
For structural typing.
An alternative to std::tuple that compiles more quickly.
For accessing fields of a struct by index or name.
Advanced topics
For supporting your own serialization and deserialization formats.
Instructions for ensuring backwards-compatible APIs.
Extensive benchmarks of popular serialization libraries.