I also tried the JSON for Modern C++ . I thought I wanted BSON, but after looking at all the wasted space in the resultant binary file, I tried CBOR, but too wasted too much space. MessagePack turned out to be nicely compact. I had a minor mysterious error if I created it with an initializer list, and then tried to assign a new datum via a string index, e.g.:
j["foo"] = "bar";
It turns out it must be one or the other. It is well-maintained and up to date. I found it easier to use the one big include. I would use an official MessagePack API, but the vanilla C++ one requires Boost++ also, and there are about six other APIs which only use MessagePack output format. This one can use multiple output formats. I might use QJsonObject, but the lack of support for storing binaries as binary was a non-starter; and the much more compact format of MessagePack, without a CPU-expensive re-encoding of binary format was a winner for me. I hope in the future, QJsonObject will support MessagePack and non-reencoded binary fields.