A C++20 library for fast serialization, deserialization, and validation using reflection, supporting JSON, Avro, CSV, Parquet, and more.
reflect-cpp is a C++20 library that enables fast serialization, deserialization, and validation of C++ objects using reflection. It solves the problem of writing repetitive boilerplate code for data interchange by providing a unified, type-safe interface across numerous formats like JSON, Avro, CSV, and Parquet. The library automatically validates data against constraints and generates clear error messages, improving code safety and developer productivity.
C++ developers working on applications that require data serialization, such as web APIs, configuration management, ETL pipelines, or database interactions. It is particularly useful for teams seeking type safety, performance, and support for multiple data formats without manual parsing code.
Developers choose reflect-cpp for its exceptional performance, comprehensive format support, and seamless integration with modern C++ idioms. Its reflection capabilities eliminate manual serialization code, while built-in validation and clear error messages reduce bugs and debugging time. The library is modular and extensible, allowing easy adoption of new formats.
A C++20 library for fast serialization, deserialization and validation using reflection. Supports JSON, Avro, Boost Serialization, BSON, Cap'n Proto, CBOR, Cereal, CSV, flexbuffers, msgpack, parquet, TOML, UBJSON, XML, YAML, yas / msgpack.org[C++20]
Open-Awesome is built by the community, for the community. Submit a project, suggest an awesome list, or help improve the catalog on GitHub.
Provides a single reflection-based interface for over 15 formats including JSON, Avro, CSV, and Parquet, drastically reducing boilerplate code across data pipelines.
Includes automatic validators for email, timestamps, numeric ranges, and custom constraints, enhancing code safety with clear error messages as shown in the README examples.
Benchmarks cited in the documentation position it as one of the fastest serialization libraries, leveraging efficient backends like yyjson for JSON.
Seamlessly works with standard library containers, concepts, and modern C++ idioms, supporting everything from std::vector to algebraic data types without intrusive changes.
Enables runtime and compile-time field iteration, replacement, and struct composition beyond serialization, useful for dynamic configuration and meta-programming.
Full format support requires vcpkg or Conan and multiple external libraries (e.g., Apache Arrow for Parquet), increasing setup complexity and potential dependency conflicts.
Mandates C++20 and recent compiler versions (GCC 11+, Clang 14+, MSVC 17.8+), excluding projects stuck on older standards or toolchains.
Features like JSON schema generation are format-specific, and support for new formats is still in development, relying on external libraries that may have their own limitations.
The reflection machinery and modular design introduce compile-time and cognitive overhead compared to lightweight, single-format libraries for straightforward tasks.