Hi,
i use the class versioning feature of Boost.Serialization, with an external (non-intrusive) serialization function like this:
BOOST_CLASS_VERSION(GAMEINFO, 1)
template <typename Archive>
void serialize(Archive &ar, GAMEINFO& gameSettings, const unsigned int version)
{
ar & gameSettings.NPODS;
// ...
if (version > 0)
ar & gameSettings.ARENA_GOAL_EXCLUSION_RADIUS;
}
Now as soon, as i set BOOST_CLASS_VERSION(GAMEINFO, 1), i get version==1 in this serialize function, even when i *deserialize* (load from archive).
I would have expected to get the version of the data in the saved archive in this case.
Say i saved with an old version=0.
Then my class evolved and i set BOOST_CLASS_VERSION(GAMEINFO, 1).
But when reading the old archive, i expect version==0 in the function so i can react on it.
Instead, i get always version==1, as soon as i compile with BOOST_CLASS_VERSION(GAMEINFO, 1), even when i'm reading old files!
What am i missing?
regards,
Lars R.