Serialization in C++ has never been easier! But wait, there's more
summary
Demonstrates how Proposal P1717 plus upcoming reflection and consteval/meta facilities produce an automatic JSON serializer that prints ints, strings, vectors, optionals and nested structs without per-type iterate_members boilerplate. Uses compile-time meta: count data members, get nth member name, unqual_id/unquote and fragment injection to generate code, and metaclasses to add members or make types noncopyable/movable. Runs on a prototype hosted at cppx.godbolt.org (log3/meta); several features (template value reflection, some injections) are still incomplete but the serializer demo works.
AI-written summary · about
chapters (8)
- 0:00Start
- 17:27Serialization only using reflection
- 22:24Unquote operator
- 24:04Fragment requirements
- 26:27Class fragment
- 28:22Enum fragment
- 30:30Namespace fragment
- 37:03Metaclasses
related talks
57mAdventures in Serialization: A Flexible Approach for Embedded Systems in C++
53mC++ Horizons
59mThe Power Of Compile-Time Resources
06mA different way to use boost serialization
03mLet's cmakeify the C++ standard library
01h 37mReflection: Compile-Time Introspection of C++
01h 02mBinary Object Serialization With Structure Traversal & Reconstruction
01h 34mMetaprogramming in C++14
