JSON in C++ - Designing a Type for Working With JSON Values
summary
Designs a C++17 JSON value type that uses C++17 std::variant-based union for null/bool/int64/double/string/array/object, documents choosing rule-of-zero for the simple version and rule-of-five when using a placement-storage workaround, and adds allocator-aware basic_value support with rebound allocators. Implements an MSVC overload workaround for ambiguous literal construction and an incomplete-type storage hack to support older libstdc++/libc++ versions. Produces a working library ~1.5k lines long and files a Clang bug for a copy-construction false negative.
AI-written summary · about
