[Serialization] How to retrieve a class version in an archive without loading?

Hello. My question is about program rollback and the management of archive compatibility : let's say I saved on object of type T with my program in version 1.35 => archive.txt. If I roll back my program to a previous version (let say 1.30), I'd like to check (without trying to deserialize for performance issue) if T in 1.30 has the same "BOOST_CLASS_VERSION" as the object saved in archive.txt. *In brief : is there a way to retrieve the BOOST_CLASS_VERSION of T stored in the archive ?* I read boost code, but I didn't find a "quite direct" way to do that. It seems I must get cobject_id_vector of basic_iarchive_impl, but all this stuff is private. Is their another non-intrusive way to do it ? (By non-intrusive I mean : only using the boost public stuff, or at least with a simple inheritance to get protected member of base classes?). Thanks in advance. nicolas.

On 10/18/2013 8:01 AM, nico wrote:
*In brief : is there a way to retrieve the BOOST_CLASS_VERSION of T stored in the archive ?*
In short, no. At least not the way you want. The class version is serialized just before the instance serialization. You would have to deserialize the archive up to the point of the first instance of the class to find this data. Cheers, Brandon
participants (2)
-
Brandon Kohn
-
nico