Consider the following scenario: there was structure A in an old version of a C++ application:
struct A
{
double a;
int b;
std::string c;
};
An instance of A was serialized into a file in a binary format and after that the application was updated to a new version.
But in the new version of the application structure A was modified by adding fields d and e and deleting field a:
struct A
{
int b;
std::vector<int> d;
bool e;
std::string c;
};
and the new version of the application needs to deserialize an instance of its new structure A from the file containing old version of A.
(more…)