2

We use boost::archive::binary_iarchive and binary_oarchive here, and run into the following issue once in a while: a developer upgrades his local Boost-version and now the data-blobs produced by his program are not readable by others, forcing them to upgrade too.

There have not been a problem in the other direction: de-serialization of data written by older Boost-versions works in newer version. Which means, the serializer's version is recorded in the data-file...

I see, that binary_oarchive takes a flags argument (which defaults to zero). Perhaps, we can request, that serializer creates blobs readable by earlier versions of itself using a flag?

Any other way to ensure, that, for example, when serializing with Boost-1.75, the archives are understood by, at least, Boost-1.65?

Mikhail T.
  • 3,043
  • 3
  • 29
  • 46
  • Is it possible for you to use a different library? I ran into this same issue and changed to Cereal. It has a very similar syntax to boost. –  Mar 30 '21 at 19:11
  • 1
    Agree with previous comment. Boost.Serialization could be more robust and compact. If [this](https://stackoverflow.com/questions/6015339/boost-serialization-archive-unsupported-version-exception) doesn't help, check out Cereal, or [capnproto](https://capnproto.org/cxx.html). – rustyx Mar 30 '21 at 19:30
  • Or Oops, which is the most robust solution from compatibility point of view: https://bitbucket.org/barczpe/oops – Peter Barczikay Dec 21 '22 at 15:38

0 Answers0