Our great sponsors
-
Magic Enum C++
Static reflection for enums (to string, from string, iteration) for modern C++, work with any enum type without any macro or boilerplate code
-
InfluxDB
Power Real-Time Data Analytics at Scale. Get real-time insights from all types of time series data with InfluxDB. Ingest, query, and analyze billions of data points in real-time with unbounded cardinality.
But for the solution I would propose, I am biased and I would use my library as it is fast, doesn't allocate(small stack usage) unless the user type allocates itself, and requires only a mapping of the JSON members needed to construct your data type(or a third party). Because the mapping is via a specialization, you can stuff it away in it's own TU and not see more than something like MyThing parse_json( string_view );. You can also do things like treat JSON arrays as an iterator or range and just dump them to API calls without having to parse the whole thing first. Like the whole GTA 5 thing, the 100MB JSON document could have been parsed in or under 100ms or so. https://github.com/beached/daw_json_link
Link for the curious: https://github.com/Neargye/magic_enum/blob/master/include/magic_enum.hpp